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 11201 for NEMO/branches/2019/ENHANCE-03_domcfg/src/domain.F90 – NEMO

Ignore:
Timestamp:
2019-07-01T12:10:15+02:00 (5 years ago)
Author:
mathiot
Message:

ENHANCE-03_domcfg : add management of closed seas in domain cfg by flood filling and lat/lon seed instead of i/j box definition (ticket #2143)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/ENHANCE-03_domcfg/src/domain.F90

    r11129 r11201  
    2323   USE dom_oce         ! domain: ocean 
    2424   USE phycst          ! physical constants 
    25    !  USE closea          ! closed seas 
    2625   USE domhgr          ! domain: set the horizontal mesh 
    2726   USE domzgr          ! domain: set the vertical mesh 
    2827   USE dommsk          ! domain: set the mask system 
    29    USE domwri          ! domain: write the meshmask file 
     28   USE domclo          ! domain: set closed sea mask 
    3029   ! 
    3130   USE in_out_manager  ! I/O manager 
     
    7574      !                       !==  Reference coordinate system  ==! 
    7675      ! 
    77       CALL dom_nam               ! read namelist ( namrun, namdom ) 
    78       ! 
    79       !   CALL dom_clo               ! Closed seas and lake 
     76      CALL dom_nam                  ! read namelist ( namrun, namdom ) 
     77      ! 
     78      CALL dom_hgr                  ! Horizontal mesh 
     79      ! 
     80      CALL dom_zgr                  ! Vertical mesh and bathymetry 
     81      ! 
     82      IF ( ln_domclo .OR. nmsh > 0 ) CALL dom_msk                  ! compute mask (needed by dom_clo 
     83      ! 
     84      IF ( ln_domclo ) CALL dom_clo ! Closed seas and lake 
    8085      !  
    81       CALL dom_hgr               ! Horizontal mesh 
    82       ! 
    83       CALL dom_zgr               ! Vertical mesh and bathymetry 
    84       ! 
    85       CALL dom_msk               ! Masks 
    86       ! 
    87       ht_0(:,:) = e3t_0(:,:,1) * tmask(:,:,1)   ! Reference ocean thickness 
    88       hu_0(:,:) = e3u_0(:,:,1) * umask(:,:,1) 
    89       hv_0(:,:) = e3v_0(:,:,1) * vmask(:,:,1) 
    90       DO jk = 2, jpk 
    91          ht_0(:,:) = ht_0(:,:) + e3t_0(:,:,jk) * tmask(:,:,jk) 
    92          hu_0(:,:) = hu_0(:,:) + e3u_0(:,:,jk) * umask(:,:,jk) 
    93          hv_0(:,:) = hv_0(:,:) + e3v_0(:,:,jk) * vmask(:,:,jk) 
    94       END DO 
    95       ! 
    96       CALL cfg_write             ! create the configuration file 
    97       ! 
    98       CALL dom_wri 
     86      CALL cfg_write                ! create the configuration file 
    9987      ! 
    10088   END SUBROUTINE dom_init 
     
    118106      NAMELIST/namdom/ nn_bathy, cn_topo, cn_bath, cn_lon, cn_lat, nn_interp,                        & 
    119107         &             rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin, rn_isfhmin,           & 
    120          &             rn_atfp , rn_rdt   , nn_closea   , ln_crs      , jphgr_msh ,                  & 
     108         &             rn_atfp , rn_rdt   , ln_crs      , jphgr_msh ,                  & 
    121109         &             ppglam0, ppgphi0, ppe1_deg, ppe2_deg, ppe1_m, ppe2_m,                         & 
    122110         &             ppsur, ppa0, ppa1, ppkth, ppacr, ppdzmin, pphmax, ldbletanh,                  & 
     
    142130         WRITE(numout,*) '~~~~~~~ ' 
    143131         WRITE(numout,*) '   Namelist namrun' 
    144          WRITE(numout,*) '      job number                      nn_no      = ', nn_no 
    145132         WRITE(numout,*) '      experiment name for output      cn_exp     = ', cn_exp 
    146          WRITE(numout,*) '      file prefix restart input       cn_ocerst_in= ', cn_ocerst_in 
    147          WRITE(numout,*) '      restart input directory         cn_ocerst_indir= ', cn_ocerst_indir 
    148          WRITE(numout,*) '      file prefix restart output      cn_ocerst_out= ', cn_ocerst_out 
    149          WRITE(numout,*) '      restart output directory        cn_ocerst_outdir= ', cn_ocerst_outdir 
    150          WRITE(numout,*) '      restart logical                 ln_rstart  = ', ln_rstart 
    151          WRITE(numout,*) '      start with forward time step    nn_euler   = ', nn_euler 
    152          WRITE(numout,*) '      control of time step            nn_rstctl  = ', nn_rstctl 
    153          WRITE(numout,*) '      number of the first time step   nn_it000   = ', nn_it000 
    154          WRITE(numout,*) '      number of the last time step    nn_itend   = ', nn_itend 
    155          WRITE(numout,*) '      initial calendar date aammjj    nn_date0   = ', nn_date0 
    156          WRITE(numout,*) '      initial time of day in hhmm     nn_time0   = ', nn_time0 
    157          WRITE(numout,*) '      leap year calendar (0/1)        nn_leapy   = ', nn_leapy 
    158          WRITE(numout,*) '      initial state output            nn_istate  = ', nn_istate 
    159          IF( ln_rst_list ) THEN 
    160             WRITE(numout,*) '      list of restart dump times      nn_stocklist   =', nn_stocklist 
    161          ELSE 
    162             WRITE(numout,*) '      frequency of restart file       nn_stock   = ', nn_stock 
    163          ENDIF 
    164          WRITE(numout,*) '      frequency of output file        nn_write   = ', nn_write 
    165133         WRITE(numout,*) '      mask land points                ln_mskland = ', ln_mskland 
    166134         WRITE(numout,*) '      additional CF standard metadata ln_cfmeta  = ', ln_cfmeta 
    167135         WRITE(numout,*) '      overwrite an existing file      ln_clobber = ', ln_clobber 
    168136         WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz = ', nn_chunksz 
    169          WRITE(numout,*) '      IS coupling at the restart step ln_iscpl   = ', ln_iscpl 
    170137      ENDIF 
    171138 
     
    245212         WRITE(numout,*) '           = 2   mesh and mask             ' 
    246213         WRITE(numout,*) '           = 3   mesh_hgr, msh_zgr and mask' 
    247          WRITE(numout,*) '      ocean time step                       rn_rdt    = ', rn_rdt 
    248          WRITE(numout,*) '      asselin time filter parameter         rn_atfp   = ', rn_atfp 
    249          WRITE(numout,*) '      suppression of closed seas (=0)       nn_closea = ', nn_closea 
    250          WRITE(numout,*) '      online coarsening of dynamical fields ln_crs    = ', ln_crs 
    251214         WRITE(numout,*) '      type of horizontal mesh jphgr_msh           = ', jphgr_msh 
    252215         WRITE(numout,*) '      longitude of first raw and column T-point ppglam0 = ', ppglam0 
     
    453416      END DO 
    454417      CALL iom_rstput( 0, 0, inum, 'bathy_metry'   , z2d , ktype = jp_r4 ) 
    455  
    456       ! 
    457       IF( ln_sco ) THEN             ! s-coordinate: store grid stiffness ratio  (Not required anyway) 
    458          CALL dom_stiff( z2d ) 
    459          CALL iom_rstput( 0, 0, inum, 'stiffness', z2d )        !    ! Max. grid stiffness ratio 
    460       ENDIF 
     418      ! 
     419      !                              !== closed sea ==! 
     420      IF (ln_domclo) THEN 
     421         ! mask for the open sea 
     422         CALL iom_rstput( 0, 0, inum, 'mask_opensea', msk_opnsea, ktype = jp_i4 ) 
     423         ! mask for all the under closed sea 
     424         CALL iom_rstput( 0, 0, inum, 'mask_csundef', msk_closea, ktype = jp_i4 ) 
     425         ! mask for global, local net precip, local net precip and evaporation correction 
     426         CALL iom_rstput( 0, 0, inum, 'mask_csglo', msk_glo, ktype = jp_i4 ) 
     427         CALL iom_rstput( 0, 0, inum, 'mask_csemp', msk_emp, ktype = jp_i4 ) 
     428         CALL iom_rstput( 0, 0, inum, 'mask_csrnf', msk_rnf, ktype = jp_i4 ) 
     429         ! mask for the various river mouth (in case multiple lake in the same outlet) 
     430         CALL iom_rstput( 0, 0, inum, 'mask_csgrpglo', msk_gloid, ktype = jp_i4 ) 
     431         CALL iom_rstput( 0, 0, inum, 'mask_csgrpemp', msk_empid, ktype = jp_i4 ) 
     432         CALL iom_rstput( 0, 0, inum, 'mask_csgrprnf', msk_rnfid, ktype = jp_i4 ) 
     433      END IF 
    461434      ! 
    462435      !                                ! ============================ 
Note: See TracChangeset for help on using the changeset viewer.