Perfect!!!!!!!!
Thank you Charlie. You are right. I use cos(latitude) as an area-weighting factor for both the numerator and denominator to calculate the percentage of land area experiencing temp>25, rather than absolute area in square metres. Let me know if this is ok. I really appreciate your help.
Dear Charlie, Thank you this is super helpfull. I am now calulating global land only weighted average with temerature > 25 degree. I have a ocean_land_mask_file.nc, where land 1 and ocean 0. # 1. Append the 'land_mask' variable ncks -A -v land_mask ocean_land_mask_file.nc ensmean_global.nc # 2. Calculate the grid weights, land only above 25-degree threshold ncap2 -h -O -s "grid_area=cos(lat*3.14159265/180.0); land_area=grid_area*land_mask; exceed_area=grid_area*land_mask*(tmp > 25.0);" ensmean_global.nc...
Hi all, I am trying to calculate the multimodel mean of five temperature datasets. Three datasets have global coverage (longitude: -180 to 180, latitude: -90 to 90), while two datasets only cover latitudes between -70 and 70 (longitude: -180 to 180). The two datasets will therefore contribute to the multimodel mean only within ±70° latitude, while the three global datasets provide coverage beyond ±70°. Is there a recommended way to calculate a consistent global mean while accounting for this difference...
I am kind of new to nco and i am trying to create a global time series of percentage of areas under higher rainfall (prcp > 100 mm) for the period 1979-2025. Can any help me review my code if i am doing right? I have tried in CDO and want to try if this can also be done using NCO as i am having issues with cdo on my machine. Land mask: grid cells with valid precipitation at least once during the whole period. Missing values in the dataset are currently defined as 1.e+30f cdo setmisstoc,0 -ltc,1e10...
I did solve this using nncecat -u level and ncks -A -v depth thanks for the help Charlie
Hi Charlie, I used ncks -v depth -d nlayer,2 global.nc dp1.nc and changed the values. to update the original file, I merge the variable to the original file using different name (dp1) ncks -A ncks -v dp1.nc global.nc and then i tried to replace the original values using the updated values as ncap2 -s 'depth(1,:,:)=dp1;' global.nc global_updated.nc This gives me the following error ncap2: ERROR assign(): Hyperslab for depth - number of elements on LHS(12956) doesn't equal number of elements on RHS(38868)...
Hi Charlie, i used ncks -v depth -d nlayer,2 global.nc dp1.nc and changed the values. to update the orginal file, I mege the varibale to the orginal file uing ncks -A ncks -v dp1.nc global.nc and then i tried to replace the orginale using the updated values ncap2 -s 'depth(1,:,:)=dp1;' global.nc global_updated.nc this gives me the following error ncap2: ERROR assign(): Hyperslab for depth - number of elements on LHS(12956) doesn't equal number of elements on RHS(38868) any idea how to solve this?...