NOAA-GFDL / FRE-NCtools

Tools for manipulating and creating netCDF inputs for FMS managed models
GNU Lesser General Public License v3.0
20 stars 28 forks source link

cr_lake_files of simple_hydrology may be producing incorrect results. #230

Open ngs333 opened 1 year ago

ngs333 commented 1 year ago

The executable cr_lake_files of simple_hydrology may be producing incorrect results.

@NoemiVergopolan has determined that one of her scripts does not correctly run with the NCTools pre-compiled version of cr_lake_files. However, if she herself compiles her version of the source code the program, then correct results are obtained. The output of the two versions differ in these fields: whole_lake_area, lake_frac, WaterBod, PWetland. For example, the ncview image for the variable WaterBod is devoid of features (suggesting data missing) for the NCView version.

Her version of the source code is /f2/dev/Noemi.Vergopolan/software/simple_hydrog/code/cr_lake_files.f90. It differs from that in NCTools on lines 804 and 805 of the NCTools version: ! create coordinate variables rcode= NF_DEF_VAR (ncid, 'grid_x', NF_DOUBLE, 1, londim, lonid) rcode= NF_DEF_VAR (ncid, 'grid_y', NF_DOUBLE, 1, latdim, latid) and her code: rcode= NF_DEF_VAR (ncid, 'grid_x', NF_DOUBLE, 1, (/ londim /), lonid) rcode= NF_DEF_VAR (ncid, 'grid_y', NF_DOUBLE, 1, (/ latdim /), latid)

The behavior may be reproduced on gaea with the attached script (csh suffixes were changed to txt to allow upload) run.cr_simple_hydrog_gaea_nctools.txt run.cr_simple_hydrog_gaea.txt

ngs333 commented 1 year ago

@MJHarrison-GFDL though you might be intrested in this