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 13369 for utils/tools/SIREN/src/create_meshmask.f90 – NEMO

Ignore:
Timestamp:
2020-07-31T10:50:52+02:00 (4 years ago)
Author:
jpaul
Message:

update: cf changelog inside documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/tools/SIREN/src/create_meshmask.f90

    r12080 r13369  
    1414!> @section sec1 method 
    1515!>  bathymetry (and optionally ice shelf draft) is read on input file.<br/> 
    16 !>  horizontal grid-point position, scale factors, and the coriolis factor  
    17 !>  are read in coordinates file or computed.<br/>  
     16!>  horizontal grid-point position, scale factors, and the coriolis factor 
     17!>  are read in coordinates file or computed.<br/> 
    1818!>  vertical coordinate is defined, and the bathymetry recomputed to fit the 
    1919!>  vertical grid.<br/> 
     
    2222!>  all the variables read and or computed, are writen in one to three file(s) depending on 
    2323!>  output option. 
    24 !>  @note  
     24!>  @note 
    2525!>    the file contain depends on 
    2626!>    the vertical coordinate used (z-coord, partial steps, s-coord) 
     
    6060!> 
    6161!>    here after, each sub-namelist parameters is detailed. 
    62 !>    @note  
     62!>    @note 
    6363!>       default values are specified between brackets 
    6464!> 
     
    7979!>          - none 
    8080!> 
    81 !>    - **in_maxerror** [@a 5]<br/>  
     81!>    - **in_maxerror** [@a 5]<br/> 
    8282!>       maximum number of error allowed 
    8383!> 
     
    8787!>    - **cn_varcfg** [@a ./cfg/variable.cfg]<br/> 
    8888!>       path to the variable configuration file.<br/> 
    89 !>       the variable configuration file defines standard name,  
    90 !>       default interpolation method, axis,...  
    91 !>       to be used for some known variables.<br/>  
    92 !> 
    93 !>    - **cn_dimcfg** [@a ./cfg/dimension.cfg]<br/>  
    94 !>       path to the dimension configuration file.<br/>  
    95 !>       the dimension configuration file defines dimensions allowed.<br/>  
    96 !> 
    97 !>    - **cn_dumcfg** [@a ./cfg/dummy.cfg]<br/>  
     89!>       the variable configuration file defines standard name, 
     90!>       default interpolation method, axis,... 
     91!>       to be used for some known variables.<br/> 
     92!> 
     93!>    - **cn_dimcfg** [@a ./cfg/dimension.cfg]<br/> 
     94!>       path to the dimension configuration file.<br/> 
     95!>       the dimension configuration file defines dimensions allowed.<br/> 
     96!> 
     97!>    - **cn_dumcfg** [@a ./cfg/dummy.cfg]<br/> 
    9898!>       path to the useless (dummy) configuration file.<br/> 
    99 !>       the dummy configuration file defines useless  
     99!>       the dummy configuration file defines useless 
    100100!>       dimension or variable. these dimension(s) or variable(s) will not be 
    101101!>       processed.<br/> 
    102102!> 
    103 !> @subsection subsrc namsrc  
     103!> @subsection subsrc namsrc 
    104104!>    the source grid sub-namelist parameters are : 
    105105!> 
     
    204204!>       double tanh function parameter 
    205205!> 
    206 !>     @note  
     206!>     @note 
    207207!>       If *dn_ppa1*, *dn_ppa0* and *dn_ppsur* are undefined, 
    208208!>       NEMO will compute them from *dn_ppdzmin, dn_pphmax, dn_ppkth, dn_ppacr* 
     
    266266!>       lateral boundary conditions at the coast (modify fmask) 
    267267!>       -     shlat = 0 : free slip 
    268 !>       - 0 < shlat < 2 : partial slip  
     268!>       - 0 < shlat < 2 : partial slip 
    269269!>       -     shlat = 2 : no slip 
    270270!>       -     shlat > 2 : strong slip 
    271271!> 
    272 !>    for more information see Boundary Condition at the Coast  
     272!>    for more information see Boundary Condition at the Coast 
    273273!>    in [NEMO documentation](https://forge.ipsl.jussieu.fr/nemo/chrome/site/doc/NEMO/manual/pdf/NEMO_manual.pdf) 
    274274!> 
     
    312312!>       - if niproc, and njproc are provided : the program only look for land 
    313313!>         processor to be removed 
    314 !>       - if nproc is provided : the program compute each possible domain layout,  
    315 !>         and save the one with the most land processor to be removed  
     314!>       - if nproc is provided : the program compute each possible domain layout, 
     315!>         and save the one with the most land processor to be removed 
    316316!>       - with no information about number of processors, the program 
    317317!>         assume to use only one processor 
     
    326326!>    @note 
    327327!>        - if 0 < in_msh <= 3: write full 3D arrays for e3[tuvw] and gdep[tuvw] 
    328 !>        - if 3 < in_msh <= 6: write full 3D arrays for e3[tuvw] and 2D arrays  
     328!>        - if 3 < in_msh <= 6: write full 3D arrays for e3[tuvw] and 2D arrays 
    329329!>                            corresponding to the depth of the bottom t- and w-points 
    330330!>        - if 6 < in_msh <= 9: write 2D arrays corresponding to the depth and the 
     
    405405 
    406406   TYPE(TDIM)                                     :: tl_dim 
    407     
     407 
    408408   TYPE(TVAR)                                     :: tl_bathy 
    409409   TYPE(TVAR)                                     :: tl_risfdep 
     
    438438   ! namelist variable 
    439439   ! namlog 
    440    CHARACTER(LEN=lc) :: cn_logfile  = 'create_meshmask.log'  
    441    CHARACTER(LEN=lc) :: cn_verbosity= 'warning'  
     440   CHARACTER(LEN=lc) :: cn_logfile  = 'create_meshmask.log' 
     441   CHARACTER(LEN=lc) :: cn_verbosity= 'warning' 
    442442   INTEGER(i4)       :: in_maxerror = 5 
    443443 
    444444   ! namcfg 
    445    CHARACTER(LEN=lc) :: cn_varcfg   = './cfg/variable.cfg'  
     445   CHARACTER(LEN=lc) :: cn_varcfg   = './cfg/variable.cfg' 
    446446   CHARACTER(LEN=lc) :: cn_dimcfg   = './cfg/dimension.cfg' 
    447447   CHARACTER(LEN=lc) :: cn_dumcfg   = './cfg/dummy.cfg' 
     
    470470   ! namout 
    471471   CHARACTER(LEN=lc) :: cn_domcfg   = 'domain_cfg.nc' 
    472    INTEGER(i4)       :: in_msh      = 0  
     472   INTEGER(i4)       :: in_msh      = 0 
    473473   CHARACTER(LEN=lc) :: cn_type     = 'cdf' 
    474474   INTEGER(i4)       :: in_nproc    = 0 
     
    513513   &  in_niproc,     &  !< i-direction number of processor 
    514514   &  in_njproc         !< j-direction numebr of processor 
    515    !-------------------------------------------------------------------    
     515   !------------------------------------------------------------------- 
    516516 
    517517   ! 
     
    525525   IF( il_narg /= 1 )THEN 
    526526      WRITE(cl_errormsg,*) ' ERROR : one argument is needed ' 
    527       CALL fct_help(cp_myname,cl_errormsg)  
     527      CALL fct_help(cp_myname,cl_errormsg) 
    528528      CALL EXIT(1) 
    529529   ELSE 
     
    560560               IF( il_status /= 0 )THEN 
    561561                  WRITE(cl_errormsg,*) " ERROR : error opening "//TRIM(cl_namelist) 
    562                   CALL fct_help(cp_myname,cl_errormsg)  
     562                  CALL fct_help(cp_myname,cl_errormsg) 
    563563                  CALL EXIT(1) 
    564564               ENDIF 
    565565 
    566566               READ( il_fileid, NML = namlog ) 
    567   
     567 
    568568               ! define logger file 
    569569               CALL logger_open(TRIM(cn_logfile),TRIM(cn_verbosity),in_maxerror) 
     
    599599 
    600600               WRITE(cl_errormsg,*) " ERROR : can't find "//TRIM(cl_namelist) 
    601                CALL fct_help(cp_myname,cl_errormsg)  
     601               CALL fct_help(cp_myname,cl_errormsg) 
    602602               CALL EXIT(1) 
    603603 
     
    618618   ELSE 
    619619      CALL logger_fatal("CREATE MESH MASK: no input bathymetry file found. "//& 
    620       &     "check namelist")       
     620      &     "check namelist") 
    621621   ENDIF 
    622622 
     
    652652      tl_bathy%d_value(:,:,1,1) = 0._dp 
    653653   END WHERE 
    654   
     654 
    655655   IF ( ln_isfcav ) THEN 
    656656      WRITE(*,*) 'ICESHELF DRAFT FILE TO BE USED:',TRIM(cn_isfdep) 
     
    662662      ELSE 
    663663         CALL logger_fatal("CREATE MESH MASK: no input Iceshelf draft '//& 
    664             &  'file found. check namelist")       
     664            &  'file found. check namelist") 
    665665      ENDIF 
    666666 
     
    709709   ! compute horizontal mesh 
    710710   WRITE(*,*) "COMPUTE HORIZONTAL MESH" 
    711    CALL grid_hgr_fill(tl_namh,jpi,jpj,ll_domcfg)       
     711   CALL grid_hgr_fill(tl_namh,jpi,jpj,ll_domcfg) 
    712712 
    713713   ! Vertyical  mesh (dom_zgr) ------------------------------------------------- 
     
    717717   CALL grid_zgr_init(jpi,jpj,jpk,ln_sco) 
    718718   IF( ln_zps    ) CALL grid_zgr_zps_init(jpi,jpj) 
    719    IF( ln_sco    ) CALL grid_zgr_sco_init(jpi,jpj)  
     719   IF( ln_sco    ) CALL grid_zgr_sco_init(jpi,jpj) 
    720720 
    721721   ! compute vertical  mesh 
     
    729729   ! Maximum stiffness ratio/hydrostatic consistency 
    730730   IF( ln_sco    ) CALL grid_zgr_sco_stiff(tl_namz,jpi,jpj,jpk) 
    731   
     731 
    732732   ! clean 
    733733   CALL var_clean(tl_bathy) 
    734734 
    735735   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    736    ! create ouptut structure  
     736   ! create ouptut structure 
    737737   IF( in_niproc == 0 .AND. & 
    738738   &   in_njproc == 0 .AND. & 
     
    768768         tl_mpphgr=>tl_mppout0 
    769769         tl_mppzgr=>tl_mppout0 
    770           
     770 
    771771         !                                  ! ============================ 
    772       CASE ( 2 )                            !  create 'mesh.nc' and  
     772      CASE ( 2 )                            !  create 'mesh.nc' and 
    773773         !                                  !         'mask.nc' files 
    774774         !                                  ! ============================ 
     
    823823      tl_scalar=var_init('jpkglo', il_tmp(:), id_type=NF90_INT, td_dim=tl_dim) 
    824824      CALL mpp_add_var(tl_mppmsk, tl_scalar) 
    825        
     825 
    826826      il_tmp(:)=tl_mppout0%i_perio 
    827827      tl_scalar=var_init('jperio', il_tmp(:), id_type=NF90_INT, td_dim=tl_dim) 
     
    953953      CALL mpp_add_var(tl_mpphgr, tg_gcosf) 
    954954      CALL var_clean(tg_gcosf) 
    955        
     955 
    956956      ! sint 
    957957      CALL mpp_add_var(tl_mpphgr, tg_gsint) 
     
    967967      CALL var_clean(tg_gsinf) 
    968968   ENDIF 
    969     
     969 
    970970   !!! vertical mesh (zgr) 
    971971   !!!---------------------- 
    972972   ! note that mbkt is set to 1 over land ==> use surface tmask 
    973    !  
     973   ! 
    974974   ! mbathy 
    975975   tg_mbathy%d_value(:,:,:,:) = tg_ssmask%d_value(:,:,:,:) * & 
     
    10001000      tl_risfdep%d_value(:,:,:,:) = tl_risfdep%d_value(:,:,:,:) * & 
    10011001      &                             tg_mikt%d_value(:,:,:,:) 
    1002   
     1002 
    10031003      CALL mpp_add_var(tl_mppzgr, tl_risfdep) 
    10041004      CALL var_clean(tl_risfdep) 
     
    10781078         CALL mpp_add_var(tl_mppzgr, tg_gdepw_1d) 
    10791079         CALL var_clean(tg_gdepw_1d) 
    1080           
     1080 
    10811081         ! gdept_0 
    1082          CALL mpp_add_var(tl_mppzgr, tg_gdept_0)       
     1082         CALL mpp_add_var(tl_mppzgr, tg_gdept_0) 
    10831083         CALL var_clean(tg_gdept_0) 
    10841084         ! gdepw_0 
    1085          CALL mpp_add_var(tl_mppzgr, tg_gdepw_0)       
     1085         CALL mpp_add_var(tl_mppzgr, tg_gdepw_0) 
    10861086         CALL var_clean(tg_gdepw_0) 
    10871087      ENDIF 
     
    11081108      ELSE 
    11091109 
    1110          DO jj = 1,jpj    
     1110         DO jj = 1,jpj 
    11111111            DO ji = 1,jpi 
    11121112               ik=tg_mbkt%d_value(ji,jj,1,1) 
     
    11161116                  &                         tg_ssmask%d_value(ji,jj,1,1) 
    11171117            END DO 
    1118          END DO          
     1118         END DO 
    11191119         ! e3t_ps 
    11201120         CALL mpp_add_var(tl_mppzgr, tg_e3tp) 
     
    11271127 
    11281128      IF( ll_domcfg .OR. in_msh <= 3 ) THEN ! 3D depth 
    1129           
     1129 
    11301130         IF( .NOT. tl_namz%l_e3_dep )THEN 
    1131        
     1131 
    11321132            ! gdepu, gdepv 
    11331133            IF( .NOT. ll_domcfg )THEN 
     
    11391139 
    11401140               DEALLOCATE(dl_tmp3D) 
    1141                DO jk = 1,jpk    
    1142                   DO jj = 1, jpj-1    
     1141               DO jk = 1,jpk 
     1142                  DO jj = 1, jpj-1 
    11431143                     DO ji = 1, jpi-1   ! vector opt. 
    11441144                        tl_gdepu%d_value(ji,jj,jk,1) = MIN( tg_gdept_0%d_value(ji  ,jj  ,jk,1) , & 
     
    11471147                        tl_gdepv%d_value(ji,jj,jk,1) = MIN( tg_gdept_0%d_value(ji  ,jj  ,jk,1) , & 
    11481148                           &                                tg_gdept_0%d_value(ji  ,jj+1,jk,1) ) 
    1149                      END DO    
    1150                   END DO    
    1151                END DO          
     1149                     END DO 
     1150                  END DO 
     1151               END DO 
    11521152               CALL lbc_lnk( tl_gdepu%d_value(:,:,:,1), 'U', in_perio, 1._dp ) 
    11531153               CALL lbc_lnk( tl_gdepv%d_value(:,:,:,1), 'V', in_perio, 1._dp ) 
     
    11781178 
    11791179         DEALLOCATE(dl_tmp2D) 
    1180          DO jj = 1,jpj    
     1180         DO jj = 1,jpj 
    11811181            DO ji = 1,jpi 
    11821182               ik=tg_mbkt%d_value(ji,jj,1,1) 
     
    12091209   ENDIF 
    12101210 
    1211    IF( ln_zps .OR. ln_zco )THEN ! z-coordinate  
     1211   IF( ln_zps .OR. ln_zco )THEN ! z-coordinate 
    12121212      IF( .NOT. tl_namz%l_e3_dep )THEN 
    12131213         ! depth 
     
    12331233         tl_att=att_init("Created_by","SIREN create_meshmask") 
    12341234         CALL mpp_add_att(tl_mppmsk, tl_att) 
    1235           
     1235 
    12361236         !add source url 
    12371237         cl_url=fct_split(fct_split(cp_url,2,'$'),2,'URL:') 
     
    12431243         tl_att=att_init("Creation_date",TRIM(cl_date)) 
    12441244         CALL mpp_add_att(tl_mppmsk, tl_att) 
    1245           
     1245 
    12461246         ! add attribute periodicity 
    12471247         il_attid=0 
     
    12531253            CALL mpp_add_att(tl_mppmsk,tl_att) 
    12541254         ENDIF 
    1255           
     1255 
    12561256         il_attid=0 
    12571257         IF( ASSOCIATED(tl_mppmsk%t_proc(1)%t_att) )THEN 
     
    12621262            CALL mpp_add_att(tl_mppmsk,tl_att) 
    12631263         ENDIF 
    1264           
     1264 
    12651265         ji=1 
    12661266         DO WHILE( tl_gatt(ji)%c_name /= '' ) 
     
    12711271         ! create file 
    12721272         CALL iom_mpp_create(tl_mppmsk) 
    1273           
     1273 
    12741274         ! write file 
    12751275         CALL iom_mpp_write_file(tl_mppmsk) 
    12761276         ! close file 
    12771277         CALL iom_mpp_close(tl_mppmsk) 
    1278           
     1278 
    12791279         ! clean 
    12801280         CALL mpp_clean(tl_mppmsk) 
     
    12851285         CALL mpp_add_att(tl_mppmsk, tl_att) 
    12861286         CALL mpp_add_att(tl_mpphgr, tl_att) 
    1287           
     1287 
    12881288         !add source url 
    12891289         cl_url=fct_split(fct_split(cp_url,2,'$'),2,'URL:') 
     
    12971297         CALL mpp_add_att(tl_mppmsk, tl_att) 
    12981298         CALL mpp_add_att(tl_mpphgr, tl_att) 
    1299           
     1299 
    13001300         ! add attribute periodicity 
    13011301         il_attid=0 
     
    13081308            CALL mpp_add_att(tl_mpphgr,tl_att) 
    13091309         ENDIF 
    1310           
     1310 
    13111311         il_attid=0 
    13121312         IF( ASSOCIATED(tl_mppmsk%t_proc(1)%t_att) )THEN 
     
    13251325            ji=ji+1 
    13261326         ENDDO 
    1327           
     1327 
    13281328         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    13291329         ! create mask file 
    13301330         !----------------- 
    13311331         CALL iom_mpp_create(tl_mppmsk) 
    1332           
     1332 
    13331333         ! write file 
    13341334         CALL iom_mpp_write_file(tl_mppmsk) 
    13351335         ! close file 
    13361336         CALL iom_mpp_close(tl_mppmsk) 
    1337           
     1337 
    13381338         ! clean 
    13391339         CALL mpp_clean(tl_mppmsk) 
     
    13421342         !----------------- 
    13431343         CALL iom_mpp_create(tl_mpphgr) 
    1344           
     1344 
    13451345         ! write file 
    13461346         CALL iom_mpp_write_file(tl_mpphgr) 
    13471347         ! close file 
    13481348         CALL iom_mpp_close(tl_mpphgr) 
    1349           
     1349 
    13501350         ! clean 
    13511351         CALL mpp_clean(tl_mpphgr) 
     
    13571357         CALL mpp_add_att(tl_mpphgr, tl_att) 
    13581358         CALL mpp_add_att(tl_mppzgr, tl_att) 
    1359           
     1359 
    13601360         !add source url 
    13611361         cl_url=fct_split(fct_split(cp_url,2,'$'),2,'URL:') 
     
    13711371         CALL mpp_add_att(tl_mpphgr, tl_att) 
    13721372         CALL mpp_add_att(tl_mppzgr, tl_att) 
    1373           
     1373 
    13741374         ! add attribute periodicity 
    13751375         il_attid=0 
     
    13831383            CALL mpp_add_att(tl_mppzgr,tl_att) 
    13841384         ENDIF 
    1385   
     1385 
    13861386         il_attid=0 
    13871387         IF( ASSOCIATED(tl_mppmsk%t_proc(1)%t_att) )THEN 
     
    14071407         !----------------- 
    14081408         CALL iom_mpp_create(tl_mppmsk) 
    1409   
     1409 
    14101410         ! write file 
    14111411         CALL iom_mpp_write_file(tl_mppmsk) 
    14121412         ! close file 
    14131413         CALL iom_mpp_close(tl_mppmsk) 
    1414   
     1414 
    14151415         ! clean 
    14161416         WRITE(*,*) "CLEAN MSK" 
     
    14201420         !----------------- 
    14211421         CALL iom_mpp_create(tl_mpphgr) 
    1422   
     1422 
    14231423         ! write file 
    14241424         CALL iom_mpp_write_file(tl_mpphgr) 
    14251425         ! close file 
    14261426         CALL iom_mpp_close(tl_mpphgr) 
    1427   
     1427 
    14281428         ! clean 
    14291429         WRITE(*,*) "CLEAN HGR" 
     
    14341434         WRITE(*,*) "CREATE ZGR" 
    14351435         CALL iom_mpp_create(tl_mppzgr) 
    1436   
     1436 
    14371437         ! write file 
    14381438         WRITE(*,*) "WRITE ZGR" 
     
    14411441         WRITE(*,*) "CLOSE ZGR" 
    14421442         CALL iom_mpp_close(tl_mppzgr) 
    1443   
     1443 
    14441444         ! clean 
    14451445         WRITE(*,*) "CLEAN ZGR" 
     
    14691469CONTAINS 
    14701470   !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    1471    SUBROUTINE create_meshmask__mask(td_nam,jpi,jpj,jpk,ld_domcfg)  
     1471   SUBROUTINE create_meshmask__mask(td_nam,jpi,jpj,jpk,ld_domcfg) 
    14721472   !------------------------------------------------------------------- 
    1473    !> @brief This subroutine compute land/ocean mask arrays at tracer points,  
    1474    !>      horizontal velocity points (u & v), vorticity points (f) and  
    1475    !>      barotropic stream function  points (b).  
     1473   !> @brief This subroutine compute land/ocean mask arrays at tracer points, 
     1474   !>      horizontal velocity points (u & v), vorticity points (f) and 
     1475   !>      barotropic stream function  points (b). 
    14761476   !> 
    14771477   !> @details 
    14781478   !> 
    1479    !> ** Method  :   The ocean/land mask is computed from the basin bathymetry in level (mbathy)  
     1479   !> ** Method  :   The ocean/land mask is computed from the basin bathymetry in level (mbathy) 
    14801480   !>      which is defined or read in dommba. 
    14811481   !>      mbathy equals 0 over continental T-point and the number of ocean level over the ocean. 
    14821482   !> 
    14831483   !>      At a given position (ji,jj,jk) the ocean/land mask is given by: 
    1484    !>      - t-point :  
     1484   !>      - t-point : 
    14851485   !>             - 0. IF mbathy( ji ,jj) =< 0 
    14861486   !>             - 1. IF mbathy( ji ,jj) >= jk 
    1487    !>      - u-point :  
     1487   !>      - u-point : 
    14881488   !>             - 0. IF mbathy( ji ,jj)  or mbathy(ji+1, jj ) =< 0 
    14891489   !>             - 1. IF mbathy( ji ,jj) and mbathy(ji+1, jj ) >= jk. 
    1490    !>      - v-point :  
     1490   !>      - v-point : 
    14911491   !>             - 0. IF mbathy( ji ,jj)  or mbathy( ji ,jj+1) =< 0 
    14921492   !>             - 1. IF mbathy( ji ,jj) and mbathy( ji ,jj+1) >= jk. 
    1493    !>      - f-point :  
     1493   !>      - f-point : 
    14941494   !>             - 0. IF mbathy( ji ,jj)  or mbathy( ji ,jj+1) or mbathy(ji+1,jj)  or mbathy(ji+1,jj+1) =< 0 
    14951495   !>             - 1. IF mbathy( ji ,jj) and mbathy( ji ,jj+1) and mbathy(ji+1,jj) and mbathy(ji+1,jj+1) >= jk. 
     
    15011501   !> 
    15021502   !> @warning do not set the lateral friction through the value of fmask along 
    1503    !>      the coast and topography.  
     1503   !>      the coast and topography. 
    15041504   !> 
    15051505   !> @note If nperio not equal to 0, the land/ocean mask arrays 
     
    15171517   !>        - bmask is  set to 0 on the open boundaries. 
    15181518   !> 
    1519    !> ** Action :    
     1519   !> ** Action : 
    15201520   !>       - tmask    : land/ocean mask at t-point (=0. or 1.) 
    15211521   !>       - umask    : land/ocean mask at u-point (=0. or 1.) 
     
    15391539      IMPLICIT NONE 
    15401540 
    1541       ! Argument       
     1541      ! Argument 
    15421542      TYPE(TNAMH), INTENT(IN) :: td_nam 
    15431543      INTEGER(i4), INTENT(IN) :: jpi 
     
    15881588                  tg_tmask%d_value(ji,jj,jk,1) = 1._dp 
    15891589               ENDIF 
    1590             ENDDO   
    1591          ENDDO   
    1592       ENDDO   
    1593        
     1590            ENDDO 
     1591         ENDDO 
     1592      ENDDO 
     1593 
    15941594      ! (ISF) define barotropic mask and mask the ice shelf point 
    15951595      tg_ssmask%d_value(:,:,1,1)=tg_tmask%d_value(:,:,1,1) ! at this stage ice shelf is not masked 
    1596        
     1596 
    15971597      DO jk = 1, jpk 
    15981598         DO jj = 1, jpj 
     
    16011601                  tg_tmask%d_value(ji,jj,jk,1) = 0._dp 
    16021602               END IF 
    1603             ENDDO   
    1604          ENDDO   
     1603            ENDDO 
     1604         ENDDO 
    16051605      ENDDO 
    16061606 
     
    16181618!      ! north fold mask 
    16191619!      ! --------------- 
    1620 !      dl_tpol(1:jpi) = 1._dp  
     1620!      dl_tpol(1:jpi) = 1._dp 
    16211621!      dl_fpol(1:jpi) = 1._dp 
    16221622!      IF( td_nam%i_perio == 3 .OR. td_nam%i_perio == 4 )THEN      ! T-point pivot 
     
    16571657            ENDDO 
    16581658         ENDDO 
    1659       ENDDO       
     1659      ENDDO 
    16601660 
    16611661!      ! (ISF) MIN(1,SUM(umask)) is here to check if you have effectively at least 1 wet cell at u point 
     
    16861686!      CALL lbc_lnk( tg_ssfmask%d_value(:,:,:,1), 'F', td_nam%i_perio, 1._dp ) 
    16871687 
    1688       ! 3. Ocean/land mask at wu-, wv- and w points  
     1688      ! 3. Ocean/land mask at wu-, wv- and w points 
    16891689      !---------------------------------------------- 
    16901690!      tg_wmask%d_value (:,:,1,1) = tg_tmask%d_value(:,:,1,1) ! surface 
     
    16961696!                                     & tg_tmask%d_value(:,:,jk-1,1) 
    16971697!         tg_wumask%d_value(:,:,jk,1) = tg_umask%d_value(:,:,jk  ,1) * & 
    1698 !                                     & tg_umask%d_value(:,:,jk-1,1)    
     1698!                                     & tg_umask%d_value(:,:,jk-1,1) 
    16991699!         tg_wvmask%d_value(:,:,jk,1) = tg_vmask%d_value(:,:,jk  ,1) * & 
    17001700!                                     & tg_vmask%d_value(:,:,jk-1,1) 
     
    17021702 
    17031703      ! Lateral boundary conditions on velocity (modify fmask) 
    1704       ! ---------------------------------------      
     1704      ! --------------------------------------- 
    17051705      IF( .NOT. ld_domcfg )THEN 
    17061706         ALLOCATE( zwf(jpi,jpj) ) 
    17071707         DO jk = 1, jpk 
    1708             zwf(:,:) = tg_fmask%d_value(:,:,jk,1)          
     1708            zwf(:,:) = tg_fmask%d_value(:,:,jk,1) 
    17091709            DO jj = 2, jpj-1 
    17101710               DO ji = 2, jpi-1   ! vector opt. 
     
    17251725                                                & MIN(1._wp, MAX(zwf(jpi,jj+1), zwf(jpi-1,jj), zwf(jpi,jj-1))) 
    17261726               ENDIF 
    1727             END DO          
     1727            END DO 
    17281728            DO ji = 2, jpi-1 
    17291729               IF( tg_fmask%d_value(ji,1,jk,1) == 0._dp )THEN 
     
    17441744!            ! Gibraltar strait  : partial slip (fmask=0.5) 
    17451745!            ij0 = 101   ;   ij1 = 101 
    1746 !            ii0 = 139   ;   ii1 = 140    
     1746!            ii0 = 139   ;   ii1 = 140 
    17471747!            tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1) =  0.5_dp 
    17481748! 
     
    17721772!         isrow = 332 - jpj 
    17731773!         ! Gibraltar Strait 
    1774 !         ii0 = 282           ;   ii1 = 283  
     1774!         ii0 = 282           ;   ii1 = 283 
    17751775!         ij0 = 201 + isrow   ;   ij1 = 241 - isrow 
    1776 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1) = 2._dp   
     1776!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1) = 2._dp 
    17771777! 
    17781778!         ! Bhosporus Strait 
    17791779!         ii0 = 314           ;   ii1 = 315 
    1780 !         ij0 = 208 + isrow   ;   ij1 = 248 - isrow  
    1781 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp   
     1780!         ij0 = 208 + isrow   ;   ij1 = 248 - isrow 
     1781!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp 
    17821782! 
    1783 !         ! Makassar Strait (Top)  
     1783!         ! Makassar Strait (Top) 
    17841784!         ii0 =  48           ;   ii1 =  48 
    17851785!         ij0 = 149 + isrow   ;   ij1 = 190 - isrow 
    1786 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 3._dp   
     1786!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 3._dp 
    17871787! 
    17881788!         ! Lombok Strait 
    17891789!         ii0 =  44           ;   ii1 =  44 
    17901790!         ij0 = 124 + isrow   ;   ij1 = 165 - isrow 
    1791 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp   
     1791!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp 
    17921792! 
    17931793!         ! Ombai Strait 
    17941794!         ii0 =  53           ;   ii1 =  53 
    17951795!         ij0 = 124 + isrow   ;   ij1 = 165 - isrow 
    1796 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp   
     1796!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp 
    17971797! 
    17981798!         ! Timor Passage 
    17991799!         ii0 =  56           ;   ii1 =  56 
    18001800!         ij0 = 124 + isrow   ;   ij1 = 165 - isrow 
    1801 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp   
     1801!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 2._dp 
    18021802! 
    18031803!         ! West Halmahera Strait 
    18041804!         ii0 =  58           ;   ii1 =  58 
    18051805!         ij0 = 141 + isrow   ;   ij1 = 182 - isrow 
    1806 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 3._dp   
     1806!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 3._dp 
    18071807! 
    18081808!         ! East Halmahera Strait 
    18091809!         ii0 =  55           ;   ii1 =  55 
    18101810!         ij0 = 141 + isrow   ;   ij1 = 182 - isrow 
    1811 !         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 3._dp   
     1811!         tg_fmask%d_value(ii0:ii1,ij0:ij1,1:jpk,1 ) = 3._dp 
    18121812!         ! 
    18131813!      ENDIF 
     
    18201820!      DEALLOCATE( dl_tpol ) 
    18211821!      DEALLOCATE( dl_fpol ) 
    1822        
     1822 
    18231823   END SUBROUTINE create_meshmask__mask 
    18241824   !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    18261826         & RESULT(tf_att) 
    18271827   !------------------------------------------------------------------- 
    1828    !> @brief  
     1828   !> @brief 
    18291829   !> this function create array of global attributes. 
    18301830   !> 
     
    18411841      IMPLICIT NONE 
    18421842 
    1843       ! Argument       
    1844       CHARACTER(LEN=*), INTENT(IN   )  :: cd_bathy  
    1845       CHARACTER(LEN=*), INTENT(IN   )  :: cd_coord  
    1846       CHARACTER(LEN=*), INTENT(IN   )  :: cd_isfdep  
    1847       TYPE(TNAMH)     , INTENT(IN   )  :: td_namh  
    1848       TYPE(TNAMZ)     , INTENT(IN   )  :: td_namz  
     1843      ! Argument 
     1844      CHARACTER(LEN=*), INTENT(IN   )  :: cd_bathy 
     1845      CHARACTER(LEN=*), INTENT(IN   )  :: cd_coord 
     1846      CHARACTER(LEN=*), INTENT(IN   )  :: cd_isfdep 
     1847      TYPE(TNAMH)     , INTENT(IN   )  :: td_namh 
     1848      TYPE(TNAMZ)     , INTENT(IN   )  :: td_namz 
    18491849 
    18501850      ! function 
     
    19591959         ji=ji+1 ; tf_att(ji)=att_init("wdld",td_namz%d_wdld) 
    19601960      ENDIF 
    1961   
     1961 
    19621962   END FUNCTION create_meshmask__gloatt 
    19631963   !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Note: See TracChangeset for help on using the changeset viewer.