Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cdfvFWov.f90 #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

janharlass
Copy link
Contributor

correct file name for mesh_zgr section

correct file name for mesh_zgr section
@janharlass janharlass mentioned this pull request Feb 15, 2019
@molines
Copy link
Member

molines commented Feb 15, 2019

Hi Jan,
In the current code, I used cn_fe3v as the file holding the vertical metrics. In modcdfnames.F90, the default value for cn_fe3v is indeed 'mesh_zgr.nc'. But this default value can be changed when using vvl (non linear free surface) because in this case, vertical metrics change with time, and the e3 field is stored in the data file, and not into the mesh_zgr.nc file.
So I think that the change you proposed, does not change anything if you are not using vvl, and probably introduce an error when using vvl...

So I am wondering why did you have trouble with this tool ?

On the other hand I also see your changes in cdfio.F90 and I'll take some time to analyse it (other issue)

So for the time being, I do not merge your request in order not to break vvl capabilities !
Cheers,
Jean-Marc

@janharlass
Copy link
Contributor Author

I think the problem is the need of cdfvFWov to work with sections files only: gridT, gridV, mesh_mask, mesh_hgr and mesh_zgr. For example in my work flow I use cdfclip to specify a section holding 2 lines of data and its convenient to name those something different than e.g. mesh_mask.nc again. Hence, cdfvFWov should open the correct file we provide with the call , specified here:
120 CASE ( '-zgr' ) ; CALL getarg( ijarg, cf_zgr ) ; ijarg=ijarg+1
as it does for the other files.

The changes in cdfio.F90 are needed as cdfvFWov uses the getvarxz function to read e3v, that changes with nemo version and I tried to keep the coding conventions.

@molines
Copy link
Member

molines commented Feb 15, 2019

Ok I got your point ! I go too quickly through your code and skipped the new option -zgr...
I agree that the hard coded name for mesh_zgr is really bad. In cdf_tools, you can also specify the default name through environnment variables (CDFT_MESH_ZGR etc .. see modcdfname.f90

`
SUBROUTINE chkenv
!!---------------------------------------------------------------------
!! *** ROUTINE chkenv ***
!!
!! ** Purpose : Check CDFT_xxx environment variables for the name of
!! mesh, mask files
!!
!! ** Method : Use getenv function
!!
!!----------------------------------------------------------------------
CHARACTER(LEN=255) :: cldum
!!----------------------------------------------------------------------

! provide facilities for environment mariables fixing basic filename
CALL getenv('CDFT_MESH_HGR',cldum ) ; IF ( cldum /= '' ) cn_fhgr    = cldum
CALL getenv('CDFT_MESH_ZGR',cldum ) ; IF ( cldum /= '' ) cn_fzgr    = cldum
CALL getenv('CDFT_MASK'    ,cldum ) ; IF ( cldum /= '' ) cn_fmsk    = cldum
CALL getenv('CDFT_BASINS'  ,cldum ) ; IF ( cldum /= '' ) cn_fbasins = cldum
CALL getenv('CDFT_COORD'   ,cldum ) ; IF ( cldum /= '' ) cn_fcoo    = cldum
! propagates cn_fzgr to e3 metrics (default)
cn_fe3t = cn_fzgr
cn_fe3u = cn_fzgr
cn_fe3v = cn_fzgr
cn_fe3w = cn_fzgr

! .. can be extended

END SUBROUTINE chkenv
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants