New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 13390 for utils/tools – NEMO

Changeset 13390 for utils/tools


Ignore:
Timestamp:
2020-08-10T11:09:15+02:00 (4 years ago)
Author:
mathiot
Message:

ticket #2502: merge ticket branch into trunk. DOMAIN_cfg namelist contains now fields to specify input files names (bathy meter and level files, coord file, isf draft meter and level files), save it into the netcdf (dom_doc.exe) and re-generate the namelist if needed (xtrac_namelist.bash). The usage is documented in the DOMAIN_cfg README.rst.

Location:
utils/tools/DOMAINcfg
Files:
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • utils/tools/DOMAINcfg/README.rst

    r12414 r13390  
    5656* id trg is a integer used to defined group of closed sea and their river outflow (for example all the great lake and the St Laurent outflow). 
    5757 
     58 
    58592) copy in DOMAINcfg directory same input files (of related configuration) required in v3.6_stable. 
    5960 
     
    8586            field_def.xml 
    8687            iodef.xml 
     88 
     89 
     90============================================================== 
     91= How to keep track of the parameter used to generate the file 
     92============================================================== 
     93To do so, you need to fill the namelist_cfg with the input file name used in 
     94cn_fcoord, cn_topo, cn_fisfd and the associated variable name (see namelist ref for the extensive list). 
     95Once you generate the domain_cfg.nc file you can run the dom_doc.exe tools available. 
     96 
     97.. code-block:: console 
     98 
     99  $ ./dom_doc.exe -h 
     100    usage : dom_doc -n NAMELIST-file  
     101                    -d DOMAIN_CFG-file 
     102        
     103      PURPOSE : 
     104         Add information in the domain_cfg.nc file after its creation for 
     105         NEMO4. The additional information consists in a new netcdf variable 
     106         called namelist_cfg, holding the content of the used namelist_cfg. 
     107        
     108      ARGUMENTS : 
     109         -n NAMELIST-file : name of the namelist_cfg. file required 
     110         -d DOMAIN_CFG-file : name of the domain_cfg file to document. file required 
     111        
     112      OUTPUT :  
     113          input DOMAIN_CFG-file is modified on output. 
     114 
     115This will add a variable namelist_cfg into the netcdf. 
     116 
     117To extract the namelist again, simply run the available script xtrac_namelist.bash 
     118:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
     119./xtrac_namelist.bash input_domain_cfg_file.nc output_namelist_cfg  
     120:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
  • utils/tools/DOMAINcfg/cpp_DOMAINcfg.fcm

    r13204 r13390  
    1  bld::tool::fppkeys 
     1 bld::tool::fppkeys key_mpp_mpi 
  • utils/tools/DOMAINcfg/namelist_ref

    r13204 r13390  
    2929   nn_interp   =    1                          ! type of interpolation (nn_bathy =2) 
    3030   cn_domcfg   = ' '       ! Name of the domain_cfg input file 
    31    cn_topo     =  'bathymetry_ORCA12_V3.3.nc'  ! external topo file (nn_bathy =2) 
    32    cn_bath     =  'Bathymetry'                 ! topo name in file  (nn_bathy =2) 
     31   cn_fcoord   =  'coordinates.nc'             ! external coordinates file (jphgr_msh = 0) 
     32   cn_topo     =  'bathy_meter.nc           '  ! external topo file (nn_bathy =1/2) 
     33   cn_topolvl  =  'bathy_level.nc           '  ! external topo file (nn_bathy =1) 
     34   cn_fisfd    =  'isf_draft_meter.nc'         ! external isf draft (nn_bathy =1 and ln_isfcav = .true.) 
     35   cn_bath     =  'Bathymetry'                 ! topo name in file  (nn_bathy =1/2) 
     36   cn_bathlvl  =  'Bathy_level'                ! lvl name in file   (nn_bathy =1) 
     37   cn_visfd    =  'isf_draft'                  ! isf draft variable (nn_bathy =1 and ln_isfcav = .true.) 
    3338   cn_lon      =  'nav_lon'                    ! lon  name in file  (nn_bathy =2) 
    3439   cn_lat      =  'nav_lat'                    ! lat  name in file  (nn_bathy =2) 
  • utils/tools/DOMAINcfg/src/dom_oce.F90

    r13204 r13390  
    4545   INTEGER, PUBLIC :: nn_interp 
    4646   CHARACTER(LEN=200), PUBLIC :: cn_topo 
     47   CHARACTER(LEN=200), PUBLIC :: cn_topolvl 
     48   CHARACTER(LEN=200), PUBLIC :: cn_fisfd 
    4749   CHARACTER(LEN=132), PUBLIC :: cn_bath 
     50   CHARACTER(LEN=132), PUBLIC :: cn_bathlvl 
     51   CHARACTER(LEN=132), PUBLIC :: cn_visfd 
     52   CHARACTER(LEN=132), PUBLIC :: cn_fcoord 
    4853   CHARACTER(LEN=132), PUBLIC :: cn_lon 
    4954   CHARACTER(LEN=132), PUBLIC :: cn_lat 
  • utils/tools/DOMAINcfg/src/domain.F90

    r13204 r13390  
    109109 
    110110      NAMELIST/namdom/ ln_read_cfg, nn_bathy, cn_domcfg, cn_topo, cn_bath, cn_lon, cn_lat, rn_scale, nn_interp, & 
    111          &              rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin,            & 
     111         &             cn_topolvl, cn_fisfd, cn_visfd, cn_bathlvl, cn_fcoord,                       &  
     112         &             rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin,                       & 
    112113         &             rn_atfp , rn_rdt   ,  ln_crs      , jphgr_msh ,                               & 
    113114         &             ppglam0, ppgphi0, ppe1_deg, ppe2_deg, ppe1_m, ppe2_m,                         & 
     
    169170         WRITE(numout,*) '   Namelist namdom : space & time domain' 
    170171         WRITE(numout,*) '      flag read/compute bathymetry      nn_bathy     = ', nn_bathy 
    171          IF( nn_bathy == 2 ) THEN 
     172         IF( nn_bathy == 1 ) THEN 
     173            WRITE(numout,*) '   read bathymetry from file      cn_topo      = ' ,TRIM(cn_topo) 
     174            WRITE(numout,*) '   bathymetry name in file        cn_bath      = ' ,TRIM(cn_bath) 
     175            WRITE(numout,*) '   read isf draft from file       cn_fisfd     = ' ,TRIM(cn_fisfd) 
     176            WRITE(numout,*) '   isf draft name in file         cn_visfd     = ' ,TRIM(cn_visfd) 
     177         ELSE IF( nn_bathy == 2 ) THEN 
    172178            WRITE(numout,*) '   compute bathymetry from file      cn_topo      = ' , cn_topo 
    173179            WRITE(numout,*) '   bathymetry name in file           cn_bath      = ' , cn_bath 
     
    435441   END SUBROUTINE cfg_write 
    436442 
    437  
    438  
    439443   !!====================================================================== 
    440444END MODULE domain 
  • utils/tools/DOMAINcfg/src/domhgr.F90

    r13204 r13390  
    465465         coordinate_filename=TRIM(cn_domcfg) 
    466466      ELSE 
    467          coordinate_filename='coordinates' 
     467         coordinate_filename=cn_fcoord 
    468468      ENDIF 
    469469      CALL iom_open( coordinate_filename, inum ) 
  • utils/tools/DOMAINcfg/src/domzgr.F90

    r13204 r13390  
    676676         ! 
    677677         IF( ln_zco )   THEN                          ! zco : read level bathymetry  
    678             CALL iom_open ( 'bathy_level.nc', inum )   
    679             CALL iom_get  ( inum, jpdom_data, 'Bathy_level', bathy ) 
     678            CALL iom_open ( cn_topolvl, inum )   
     679            CALL iom_get  ( inum, jpdom_data, cn_bathlvl, bathy ) 
    680680            CALL iom_close( inum ) 
    681681            mbathy(:,:) = INT( bathy(:,:) ) 
     
    714714#endif 
    715715            IF( ntopo == 1) THEN 
    716                CALL iom_open ( 'bathy_meter.nc', inum )  
    717                IF ( ln_isfcav ) THEN 
    718                   CALL iom_get  ( inum, jpdom_data, 'Bathymetry_isf', bathy, lrowattr=.false. ) 
    719                ELSE 
    720                   CALL iom_get  ( inum, jpdom_data, 'Bathymetry'    , bathy, lrowattr=ln_use_jattr  ) 
    721                END IF 
     716               CALL iom_open ( cn_topo, inum )  
     717               CALL iom_get  ( inum, jpdom_data, cn_bath, bathy, lrowattr=ln_use_jattr  ) 
    722718               CALL iom_close( inum ) 
    723719            ELSE 
     
    738734            ! 
    739735            IF ( ln_isfcav ) THEN 
    740                CALL iom_open ( 'isf_draft_meter.nc', inum )  
    741                CALL iom_get  ( inum, jpdom_data, 'isf_draft', risfdep ) 
     736               CALL iom_open ( cn_fisfd, inum )  
     737               CALL iom_get  ( inum, jpdom_data, cn_visfd, risfdep ) 
    742738               CALL iom_close( inum ) 
    743739            END IF 
Note: See TracChangeset for help on using the changeset viewer.