I think that i have found 2 little bugs in the code associated with detide options:
First bug
The file set_avg.F has a small bug in the end of file that break the make process for 2d apps; the endif statement is inside the #ifdef SOLVE3D directive , so when building without SOLVE3D the endif is missing (with AVERAGES+AVERAGES_DETIDE).
File: set_avg.F
Routine: set_detide_tile
SVNID: svn $Id: set_avg.F 513 2010-09-22 20:05:50Z arango $
patch:
Code: Select all
2621d2620
< END IF
2622a2622
> END IF
There is a missing directive to close the netcdf tidal forcing file after reading the tidal forcing fields. This is need because the nf90_open failed to open the file (because he is already open!). This was tricky because this bug only happens when u use hdf5/netcdf4 files ( )...
The case:
Recently i change all files to netcdf4, but forgot that the tides generally is created with n3 format. So when u try to run the model with detides plus n3 tidal frcfile, the model returns an error when trying to define a deflate level when writing the first "detide" variable CosWCosW (netcdf-4 operation in a netcdf3 file).
The most basic solution after this problem :
transform the tidal frcfile with nccopy (-k3 or -k4) and run the model again...but, when u do this, the model return an strange error (in def_tides) of not been able to open the file,just after they read the Aplitudes,periods,etc.
So,in the routine get_idata.F,before the call for def_tides we need to close the tidal forcing file to be reopened in the def_tides routine.
file: set_idata.F
routine: get_idata
SVNID: !svn $Id: get_idata.F 462 2010-05-26 17:49:25Z arango $
Patch:
Code: Select all
199a200,202
> CALL netcdf_close(ng,iNLM,ncFRCid(idTvph,ng))
> IF (exit_flag.ne.NoError) RETURN
>