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 7200 for branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90 – NEMO

Ignore:
Timestamp:
2016-11-06T17:31:33+01:00 (7 years ago)
Author:
gm
Message:

#1692 - branch SIMPLIF_2_usrdef: add depth_e3 module + management of ORCA family + domain_cfg filename (in&out) given in namelist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r7188 r7200  
    2222   !!   dom_nam       : read and contral domain namelists 
    2323   !!   dom_ctl       : control print for the ocean domain 
    24    !!   cfg_write     : create the "domain_cfg.nc" file containing all required configuration information    
     24   !!   domain_cfg    : read the global domain size in domain configuration file 
     25   !!   cfg_write     : create the domain configuration file 
    2526   !!---------------------------------------------------------------------- 
    2627   USE oce            ! ocean variables 
     
    4849   PRIVATE 
    4950 
    50    PUBLIC   dom_init   ! called by opa.F90 
     51   PUBLIC   dom_init     ! called by nemogcm.F90 
     52   PUBLIC   domain_cfg   ! called by nemogcm.F90 
    5153 
    5254   !!------------------------------------------------------------------------- 
     
    110112         END SELECT 
    111113         WRITE(numout,*)     '      Ocean model configuration used:' 
    112          WRITE(numout,*)     '              cp_cfg = ', cp_cfg 
    113          WRITE(numout,*)     '              jp_cfg = ', jp_cfg 
     114         WRITE(numout,*)     '              cn_cfg = ', cn_cfg 
     115         WRITE(numout,*)     '              nn_cfg = ', nn_cfg 
    114116      ENDIF 
    115117      ! 
     
    123125      CALL dom_glo                     ! global domain versus local domain 
    124126      CALL dom_nam                     ! read namelist ( namrun, namdom ) 
    125       CALL dom_clo( cp_cfg, jp_cfg )   ! Closed seas and lake 
     127      CALL dom_clo( cn_cfg, nn_cfg )   ! Closed seas and lake 
    126128      CALL dom_hgr                     ! Horizontal mesh 
    127129      CALL dom_zgr( ik_top, ik_bot )   ! Vertical mesh and bathymetry 
     
    287289      INTEGER  ::   ios                 ! Local integer output status for namelist read 
    288290      !!---------------------------------------------------------------------- 
    289  
     291      ! 
    290292      REWIND( numnam_ref )              ! Namelist namrun in reference namelist : Parameters of the run 
    291293      READ  ( numnam_ref, namrun, IOSTAT = ios, ERR = 901) 
    292294901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namrun in reference namelist', lwp ) 
    293  
     295      ! 
    294296      REWIND( numnam_cfg )              ! Namelist namrun in configuration namelist : Parameters of the run 
    295297      READ  ( numnam_cfg, namrun, IOSTAT = ios, ERR = 902 ) 
     
    380382      READ  ( numnam_ref, namdom, IOSTAT = ios, ERR = 903) 
    381383903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in reference namelist', lwp ) 
    382    
    383384      ! 
    384385      REWIND( numnam_cfg )              ! Namelist namdom in configuration namelist : space & time domain (bathymetry, mesh, timestep) 
     
    414415      READ  ( numnam_ref, namnc4, IOSTAT = ios, ERR = 907) 
    415416907   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namnc4 in reference namelist', lwp ) 
    416  
     417      ! 
    417418      REWIND( numnam_cfg )              ! Namelist namnc4 in configuration namelist : NETCDF 
    418419      READ  ( numnam_cfg, namnc4, IOSTAT = ios, ERR = 908 ) 
     
    492493 
    493494 
     495   SUBROUTINE domain_cfg( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     496      !!---------------------------------------------------------------------- 
     497      !!                     ***  ROUTINE dom_nam  *** 
     498      !!                     
     499      !! ** Purpose :   read the domain size in domain configuration file 
     500      !! 
     501      !! ** Method  :    
     502      !! 
     503      !!---------------------------------------------------------------------- 
     504      CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
     505      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
     506      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     507      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
     508      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
     509      ! 
     510      INTEGER ::   inum, ii   ! local integer 
     511      REAL(wp) ::   zorca_res                     ! local scalars 
     512      REAL(wp) ::   ziglo, zjglo, zkglo, zperio   !   -      - 
     513      !!---------------------------------------------------------------------- 
     514      ! 
     515      ii = 1 
     516      WRITE(ldtxt(ii),*) '           '                                                    ;   ii = ii+1 
     517      WRITE(ldtxt(ii),*) 'domain_cfg : domain size read in', TRIM( cn_domcfg ), ' file'   ;   ii = ii+1 
     518      WRITE(ldtxt(ii),*) '~~~~~~~~~~ '                                                    ;   ii = ii+1 
     519      ! 
     520      CALL iom_open( cn_domcfg, inum ) 
     521      ! 
     522      !                                   !- ORCA family specificity 
     523      IF(  iom_varid( inum, 'ORCA'           , ldstop = .FALSE. ) > 0  .AND.  & 
     524         & iom_varid( inum, 'ORCA_resolution', ldstop = .FALSE. ) > 0    ) THEN 
     525         ! 
     526         cd_cfg = 'ORCA' 
     527         CALL iom_get( inum, 'ORCA_resolution', zorca_res )   ;   kk_cfg = INT( zorca_res ) 
     528         ! 
     529         WRITE(ldtxt(ii),*) '       '                                                    ;   ii = ii+1 
     530         WRITE(ldtxt(ii),*) '       ==>>>   ORCA configuration '                         ;   ii = ii+1 
     531         WRITE(ldtxt(ii),*) '       '                                                    ;   ii = ii+1 
     532         ! 
     533      ELSE                                !- cd_cfg & k_cfg are not used 
     534         cd_cfg = 'UNKNOWN' 
     535         kk_cfg = -9999999 
     536      ENDIF 
     537      ! 
     538      CALL iom_get( inum, 'jpiglo', ziglo  )   ;   jpiglo = INT( ziglo ) 
     539      CALL iom_get( inum, 'jpjglo', zjglo  )   ;   jpjglo = INT( zjglo ) 
     540      CALL iom_get( inum, 'jpkglo', zkglo  )   ;   jpkglo = INT( zkglo ) 
     541      CALL iom_get( inum, 'jperio', zperio )   ;   jperio = INT( zperio ) 
     542      CALL iom_close( inum ) 
     543      ! 
     544      WRITE(ldtxt(ii),*) '   cn_cfg = ', TRIM(cd_cfg), '   nn_cfg = ', kk_cfg             ;   ii = ii+1 
     545      WRITE(ldtxt(ii),*) '   jpiglo = ', jpiglo                                           ;   ii = ii+1 
     546      WRITE(ldtxt(ii),*) '   jpjglo = ', jpjglo      , '   jpkglo = ', jpkglo             ;   ii = ii +1 
     547      WRITE(ldtxt(ii),*) '   jpkglo = ', jpkglo                                           ;   ii = ii +1 
     548      WRITE(ldtxt(ii),*) '   type of global domain lateral boundary   jperio = ', jperio  ;   ii = ii +1 
     549      !         
     550   END SUBROUTINE domain_cfg 
     551    
     552    
    494553   SUBROUTINE cfg_write 
    495554      !!---------------------------------------------------------------------- 
    496555      !!                  ***  ROUTINE cfg_write  *** 
    497556      !!                    
    498       !! ** Purpose :   Create the "domain_cfg" file, a NetCDF file which  
     557      !! ** Purpose :   Create the "cn_domcfg_out" file, a NetCDF file which  
    499558      !!              contains all the ocean domain informations required to  
    500559      !!              define an ocean configuration. 
     
    503562      !!              ocean configuration. 
    504563      !! 
    505       !! ** output file :   domain_cfg.nc : domain size, characteristics, horizontal mesh, 
    506       !!                              Coriolis parameter, depth and vertical scale factors 
     564      !! ** output file :   domcfg_out.nc : domain size, characteristics, horizontal  
     565      !!                       mesh, Coriolis parameter, and vertical scale factors 
     566      !!                    NB: also contain ORCA family information 
    507567      !!---------------------------------------------------------------------- 
    508568      INTEGER           ::   ji, jj, jk   ! dummy loop indices 
    509569      INTEGER           ::   izco, izps, isco, icav 
    510       INTEGER           ::   inum     ! temprary units for 'domain_cfg.nc' file 
     570      INTEGER           ::   inum     ! local units 
    511571      CHARACTER(len=21) ::   clnam    ! filename (mesh and mask informations) 
    512572      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! workspace 
     
    514574      ! 
    515575      IF(lwp) WRITE(numout,*) 
    516       IF(lwp) WRITE(numout,*) 'cfg_write : create the "domain_cfg.nc" file containing all required configuration information' 
     576      IF(lwp) WRITE(numout,*) 'cfg_write : create the domain configuration file (', TRIM(cn_domcfg_out),'.nc)' 
    517577      IF(lwp) WRITE(numout,*) '~~~~~~~~~' 
    518578      ! 
    519579      !                       ! ============================= ! 
    520       !                       !  create 'domain_cfg.nc' file  ! 
     580      !                       !  create 'domcfg_out.nc' file  ! 
    521581      !                       ! ============================= ! 
    522582      !          
    523       clnam = 'domain_cfg'  ! filename (configuration information) 
     583      clnam = 'domcfg_out'  ! filename (configuration information) 
    524584      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE., kiolib = jprstlib ) 
    525585       
     586      ! 
     587      !                             !==  ORCA family specificities  ==! 
     588      IF( cn_cfg == "ORCA" ) THEN 
     589         CALL iom_rstput( 0, 0, inum, 'ORCA'      , 1._wp            , ktype = jp_i4 ) 
     590         CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 )          
     591      ENDIF 
     592      ! 
    526593      !                             !==  global domain size  ==! 
    527594      ! 
     
    574641      !                             !==  vertical mesh  ==! 
    575642      !                                                      
    576       CALL iom_rstput( 0, 0, inum, 'e3t_1d'  , e3t_1d  , ktype = jp_r8 )   ! reference 1D-coordinate 
    577       CALL iom_rstput( 0, 0, inum, 'e3w_1d'  , e3w_1d  , ktype = jp_r8 ) 
    578       ! 
    579       CALL iom_rstput( 0, 0, inum, 'e3t_0'   , e3t_0   , ktype = jp_r8 )   ! vertical scale factors 
    580       CALL iom_rstput( 0, 0, inum, 'e3u_0'   , e3u_0   , ktype = jp_r8 ) 
    581       CALL iom_rstput( 0, 0, inum, 'e3v_0'   , e3v_0   , ktype = jp_r8 ) 
    582       CALL iom_rstput( 0, 0, inum, 'e3f_0'   , e3f_0   , ktype = jp_r8 ) 
    583       CALL iom_rstput( 0, 0, inum, 'e3w_0'   , e3w_0   , ktype = jp_r8 ) 
    584       CALL iom_rstput( 0, 0, inum, 'e3uw_0'  , e3uw_0  , ktype = jp_r8 ) 
    585       CALL iom_rstput( 0, 0, inum, 'e3vw_0'  , e3vw_0  , ktype = jp_r8 ) 
     643      CALL iom_rstput( 0, 0, inum, 'e3t_1d'  , e3t_1d , ktype = jp_r8 )   ! reference 1D-coordinate 
     644      CALL iom_rstput( 0, 0, inum, 'e3w_1d'  , e3w_1d , ktype = jp_r8 ) 
     645      ! 
     646      CALL iom_rstput( 0, 0, inum, 'e3t_0'   , e3t_0  , ktype = jp_r8 )   ! vertical scale factors 
     647      CALL iom_rstput( 0, 0, inum, 'e3u_0'   , e3u_0  , ktype = jp_r8 ) 
     648      CALL iom_rstput( 0, 0, inum, 'e3v_0'   , e3v_0  , ktype = jp_r8 ) 
     649      CALL iom_rstput( 0, 0, inum, 'e3f_0'   , e3f_0  , ktype = jp_r8 ) 
     650      CALL iom_rstput( 0, 0, inum, 'e3w_0'   , e3w_0  , ktype = jp_r8 ) 
     651      CALL iom_rstput( 0, 0, inum, 'e3uw_0'  , e3uw_0 , ktype = jp_r8 ) 
     652      CALL iom_rstput( 0, 0, inum, 'e3vw_0'  , e3vw_0 , ktype = jp_r8 ) 
    586653      !                                          
    587654      !                             !==  wet top and bottom level  ==!   (caution: multiplied by ssmask) 
Note: See TracChangeset for help on using the changeset viewer.