Changeset 7390 for branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS
- Timestamp:
- 2016-11-30T14:21:17+01:00 (8 years ago)
- Location:
- branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN
- Files:
-
- 1 deleted
- 27 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/README
r5037 r7390 1 This is a first release of SIREN.2 1 3 To create SIREN documentation, go to ./src and run doxygen2 To create SIREN documentation, run doxygen in TOOLS/SIREN directory 4 3 (http://www.stack.nl/~dimitri/doxygen/index.html version 1.8.3.1 or upper) 5 4 then 6 open . ./doc/index.html5 open ./TOOLS/SIREN/doc/html/index.html in your web browser 7 6 or 8 run ../doc/latex/gmake and open refman.pdf 9 10 11 templates of namelists could be find in templates directory. 12 read documentation for more information. 13 14 1- program to create coordinate file : 15 16 ./create_coord create_coord.nam 17 18 19 Variables are extracted from the input coordinates coarse grid and 20 interpolated to create fine coordinates files. 21 22 2- program to create bathymetry file: 23 24 ./create_bathy create_bathy.nam 25 26 Bathymetry could be extracted from fine grid Bathymetry file, or 27 interpolated from coarse grid Bathymetry file. 28 29 3- program to merge bathymetry file at boundaries : 30 31 ./merge_bathy merge_bathy.nam 32 33 Coarse grid Bathymetry is interpolated on fine grid. 34 Then fine Bathymetry and refined coarse bathymetry are merged at 35 boundaries. 36 37 4- program to create restart file : 38 39 ./create_restart create_restart.nam 40 41 Variables are read from restart file, or standard output. 42 Then theses variables are interpolated on fine grid. 43 Finally table are split over new decomposition. 44 45 5- program to create boundary files (OBC) : 46 47 ./create_boundary create_boundary.nam 48 49 Variables are read from standard output. 50 Then theses variables are interpolated on fine grid boundaries. 7 run gmake in ./TOOLS/SIREN/doc/latex directory and open ./TOOLS/SIREN/doc/latex/refman.pdf -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/cfg/dummy.cfg
r6393 r7390 1 1 &namdum 2 cn_dumvar=" "2 cn_dumvar="orca_lon", "orca_lat", "time_instant", "time_centered" 3 3 cn_dumdim="" 4 4 cn_dumatt="history" -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg
r6393 r7390 8 8 nav_lev | model_levels | Z | T | cubic | Model levels | 9 9 deptht | m | Z | T | | Vertical T levels | depth 10 ncatice | 1 | Z | T | | Ice category | num_icecat_coordinate 10 11 time_counter | | T | | | Time axis | time 11 12 Bathymetry | m | XY | T | cubic | Bathymetry | bathymetry … … 108 109 kz | | XYZT | T | | | 109 110 irondep | | XYZT | T | | | 111 sivelu | m/s | XYT | T | | Ice velocity along i-axis at I-point | sea_ice_x_velocity 112 sivelv | m/s | XYT | T | | Ice velocity along j-axis at I-point | sea_ice_y_velocity 113 siconcat | % | XYZT | T | | Ice concentration for categories | sea_ice_cat_concentration 114 sithicat | m | XYZT | T | | Ice thickness for categories | sea_ice_cat_icethickness 115 snthicat | m | XYZT | T | | Snow thickness for categories | sea_ice_cat_snowthickness 110 116 kt_ice | | | | | | 111 117 hicif | | | | | | -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/attribute.f90
r6393 r7390 141 141 END TYPE TATT 142 142 143 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ), SAVE :: cm_dumatt !< dummy attribute143 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumatt !< dummy attribute 144 144 145 145 INTERFACE att_init … … 1282 1282 ! loop indices 1283 1283 ! namelist 1284 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumvar1285 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumdim1286 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumatt1284 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 1285 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 1286 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 1287 1287 1288 1288 !---------------------------------------------------------------- … … 1345 1345 1346 1346 att_is_dummy=.FALSE. 1347 DO ji=1,ip_maxdum 1347 DO ji=1,ip_maxdumcfg 1348 1348 IF( fct_lower(td_att%c_name) == fct_lower(cm_dumatt(ji)) )THEN 1349 1349 att_is_dummy=.TRUE. -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/boundary.f90
r6393 r7390 1529 1529 !> @author J.Paul 1530 1530 !> @date November, 2013 - Initial Version 1531 ! 1531 !> @date June, 2016 1532 !> - Bug fix: take into account that boundaries are compute on T point, 1533 !> but expressed on U,V point 1534 !> 1532 1535 !> @param[inout] td_bdy boundary structure 1533 1536 !> @param[in] td_var variable structure … … 1552 1555 il_max(jp_west )=td_var%t_dim(2)%i_len 1553 1556 1554 il_maxindex(jp_north)=td_var%t_dim(2)%i_len-ip_ghost 1557 ! index expressed on U,V point, move on T point. 1558 il_maxindex(jp_north)=td_var%t_dim(2)%i_len-ip_ghost+1 1555 1559 il_maxindex(jp_south)=td_var%t_dim(2)%i_len-ip_ghost 1556 il_maxindex(jp_east )=td_var%t_dim(1)%i_len-ip_ghost 1560 il_maxindex(jp_east )=td_var%t_dim(1)%i_len-ip_ghost+1 1557 1561 il_maxindex(jp_west )=td_var%t_dim(1)%i_len-ip_ghost 1558 1562 -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_bathy.f90
r6393 r7390 22 22 !> <br/> 23 23 !> \image html bathy_40.png 24 !> \image latex bathy_30.png 24 !> <center>\image latex bathy_30.png 25 !> </center> 25 26 !> 26 27 !> @note … … 45 46 !> - cn_varcfg : variable configuration file 46 47 !> (see ./SIREN/cfg/variable.cfg) 48 !> - cn_dimcfg : dimension configuration file. defines dimension allowed 49 !> (see ./SIREN/cfg/dimension.cfg). 47 50 !> - cn_dumcfg : useless (dummy) configuration file, for useless 48 51 !> dimension or variable (see ./SIREN/cfg/dummy.cfg). … … 133 136 !> @date February, 2016 134 137 !> - do not closed sea for east-west cyclic domain 138 !> @date October, 2016 139 !> - dimension to be used select from configuration file 135 140 ! 136 141 !> @todo … … 218 223 ! namcfg 219 224 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 225 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 220 226 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 221 227 … … 248 254 NAMELIST /namcfg/ & !< configuration namelist 249 255 & cn_varcfg, & !< variable configuration file 256 & cn_dimcfg, & !< dimension configuration file 250 257 & cn_dumcfg !< dummy configuration file 251 258 … … 307 314 ! get variable extra information 308 315 CALL var_def_extra(TRIM(cn_varcfg)) 316 317 ! get dimension allowed 318 CALL dim_def_extra(TRIM(cn_dimcfg)) 309 319 310 320 ! get dummy variable … … 614 624 CALL mpp_clean(tl_coord1) 615 625 CALL mpp_clean(tl_coord0) 626 CALL var_clean_extra() 616 627 617 628 ! close log file -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_boundary.F90
r6393 r7390 26 26 !> <br/> 27 27 !> \image html boundary_NEATL36_70.png 28 !> \image latex boundary_NEATL36_70.png 28 !> <center>\image latex boundary_NEATL36_70.png 29 !> </center> 29 30 !> 30 31 !> @note … … 51 52 !> - cn_varcfg : variable configuration file 52 53 !> (see ./SIREN/cfg/variable.cfg) 54 !> - cn_dimcfg : dimension configuration file. define dimensions allowed 55 !> (see ./SIREN/cfg/dimension.cfg). 53 56 !> - cn_dumcfg : useless (dummy) configuration file, for useless 54 57 !> dimension or variable (see ./SIREN/cfg/dummy.cfg). … … 65 68 !> 66 69 !> * _vertical grid namelist (namzgr)_:<br/> 67 !> - dn_pp_to_be_computed :68 70 !> - dn_ppsur : 69 71 !> - dn_ppa0 : … … 161 163 !> - cn_north='index1(width),first1:last1|index2,first2:last2' 162 164 !> \image html boundary_50.png 163 !> \image latex boundary_50.png 165 !> <center>\image latex boundary_50.png 166 !> </center> 164 167 !> - cn_south : south boundary indices on fine grid 165 168 !> - cn_east : east boundary indices on fine grid … … 198 201 !> @date January, 2016 199 202 !> - same process use for variable extracted or interpolated from input file. 203 !> @date October, 2016 204 !> - dimension to be used select from configuration file 205 !> 206 !> @todo 207 !> - rewitre using meshmask instead of bathymetry and coordinates files. 200 208 !> 201 209 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 383 391 384 392 ! namcfg 385 CHARACTER(LEN=lc) :: cn_varcfg = 'variable.cfg' 386 CHARACTER(LEN=lc) :: cn_dumcfg = 'dummy.cfg' 393 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 394 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 395 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 387 396 388 397 ! namcrs … … 396 405 397 406 !namzgr 398 REAL(dp) :: dn_pp_to_be_computed = 0._dp399 407 REAL(dp) :: dn_ppsur = -3958.951371276829_dp 400 408 REAL(dp) :: dn_ppa0 = 103.953009600000_dp … … 445 453 NAMELIST /namcfg/ & !< config namelist 446 454 & cn_varcfg, & !< variable configuration file 455 & cn_dimcfg, & !< dimension configuration file 447 456 & cn_dumcfg !< dummy configuration file 448 457 … … 457 466 458 467 NAMELIST /namzgr/ & 459 & dn_pp_to_be_computed, &460 468 & dn_ppsur, & 461 469 & dn_ppa0, & … … 526 534 ! get variable extra information 527 535 CALL var_def_extra(TRIM(cn_varcfg)) 536 537 ! get dimension allowed 538 CALL dim_def_extra(TRIM(cn_dimcfg)) 528 539 529 540 ! get dummy variable … … 1151 1162 CALL mpp_clean(tl_coord1) 1152 1163 CALL mpp_clean(tl_coord0) 1164 CALL var_clean_extra() 1153 1165 1154 1166 CALL multi_clean(tl_multi) … … 1613 1625 1614 1626 ENDIF 1627 1615 1628 END FUNCTION create_boundary_get_level 1616 1629 !------------------------------------------------------------------- -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_coord.f90
r6393 r7390 44 44 !> - cn_varcfg : variable configuration file 45 45 !> (see ./SIREN/cfg/variable.cfg) 46 !> - cn_dimcfg : dimension configuration file. define dimensions allowed 47 !> (see ./SIREN/cfg/dimension.cfg). 46 48 !> - cn_dumcfg : useless (dummy) configuration file, for useless 47 49 !> dimension or variable (see ./SIREN/cfg/dummy.cfg). … … 76 78 !> 77 79 !> * _nesting namelist (namnst)_:<br/> 80 !> you could define sub domain with coarse grid indices or with coordinates. 78 81 !> - in_imin0 : i-direction lower left point indice 79 82 !> of coarse grid subdomain to be used … … 84 87 !> - in_jmax0 : j-direction upper right point indice 85 88 !> of coarse grid subdomain to be used 89 !> - rn_lonmin0 : lower left longitude of coarse grid subdomain to be used 90 !> - rn_lonmax0 : upper right longitude of coarse grid subdomain to be used 91 !> - rn_latmin0 : lower left latitude of coarse grid subdomain to be used 92 !> - rn_latmax0 : upper right latitude of coarse grid subdomain to be used 86 93 !> - in_rhoi : refinement factor in i-direction 87 94 !> - in_rhoj : refinement factor in j-direction<br/> 88 95 !> 89 96 !> \image html grid_zoom_40.png 90 !> \image latex grid_zoom_40.png 97 !> <center> \image latex grid_zoom_40.png 98 !> </center> 91 99 !> 92 100 !> * _output namelist (namout)_: … … 102 110 !> @date September, 2015 103 111 !> - manage useless (dummy) variable, attributes, and dimension 112 !> @date September, 2016 113 !> - allow to use coordinate to define subdomain 114 !> @date October, 2016 115 !> - dimension to be used select from configuration file 104 116 !> 105 117 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 139 151 INTEGER(i4) :: il_nvar 140 152 INTEGER(i4) :: il_ew 153 INTEGER(i4) :: il_imin0 154 INTEGER(i4) :: il_imax0 155 INTEGER(i4) :: il_jmin0 156 INTEGER(i4) :: il_jmax0 157 141 158 INTEGER(i4) , DIMENSION(ip_maxdim) :: il_rho 159 INTEGER(i4) , DIMENSION(2) :: il_index 142 160 INTEGER(i4) , DIMENSION(2,2,ip_npoint) :: il_offset 143 161 … … 167 185 ! namcfg 168 186 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 187 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 169 188 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 170 189 … … 177 196 178 197 !namnst 198 REAL(sp) :: rn_lonmin0 = -360. 199 REAL(sp) :: rn_lonmax0 = -360. 200 REAL(sp) :: rn_latmin0 = -360. 201 REAL(sp) :: rn_latmax0 = -360. 179 202 INTEGER(i4) :: in_imin0 = 0 180 203 INTEGER(i4) :: in_imax0 = 0 … … 195 218 NAMELIST /namcfg/ & ! config namelist 196 219 & cn_varcfg, & !< variable configuration file 220 & cn_dimcfg, & !< dimension configuration file 197 221 & cn_dumcfg !< dummy configuration file 198 222 … … 207 231 208 232 NAMELIST /namnst/ & ! nesting namelist 233 & rn_lonmin0, & !< lower left coarse grid longitude 234 & rn_lonmax0, & !< upper right coarse grid longitude 235 & rn_latmin0, & !< lower left coarse grid latitude 236 & rn_latmax0, & !< upper right coarse grid latitude 209 237 & in_imin0, & !< i-direction lower left point indice 210 238 & in_imax0, & !< i-direction upper right point indice … … 255 283 CALL var_def_extra(TRIM(cn_varcfg)) 256 284 285 ! get dimension allowed 286 CALL dim_def_extra(TRIM(cn_dimcfg)) 287 257 288 ! get dummy variable 258 289 CALL var_get_dummy(TRIM(cn_dumcfg)) … … 301 332 302 333 ! check nesting parameters 303 IF( in_imin0 < 0 .OR. in_imax0 < 0 .OR. in_jmin0 < 0 .OR. in_jmax0 < 0)THEN 334 il_index(:)=0 335 IF( rn_lonmin0 >= -180. .AND. rn_lonmin0 <= 360 .AND. & 336 & rn_latmin0 >= -90. .AND. rn_latmin0 <= 90. )THEN 337 338 il_index(:)=grid_get_closest(tl_coord0, & 339 & REAL(rn_lonmin0,dp), REAL(rn_latmin0,dp), & 340 & cd_pos='ll') 341 il_imin0=il_index(1) 342 il_jmin0=il_index(2) 343 ELSE 344 il_imin0=in_imin0 345 il_jmin0=in_jmin0 346 ENDIF 347 348 il_index(:)=0 349 IF( rn_lonmax0 >= -180. .AND. rn_lonmax0 <= 360 .AND. & 350 & rn_latmax0 >= -90. .AND. rn_latmax0 <= 90. )THEN 351 352 il_index(:)=grid_get_closest(tl_coord0, & 353 & REAL(rn_lonmax0,dp), REAL(rn_latmax0,dp), & 354 & cd_pos='ur') 355 il_imax0=il_index(1) 356 il_jmax0=il_index(2) 357 ELSE 358 il_imax0=in_imax0 359 il_jmax0=in_jmax0 360 ENDIF 361 362 ! forced indices for east west cyclic domain 363 IF( rn_lonmin0 == rn_lonmax0 .AND. & 364 & rn_lonmin0 /= -360. )THEN 365 il_imin0=0 366 il_imax0=0 367 ENDIF 368 369 IF( il_imin0 < 0 .OR. il_imax0 < 0 .OR. il_jmin0 < 0 .OR. il_jmax0 < 0)THEN 304 370 CALL logger_fatal("CREATE COORD: invalid points indices."//& 305 371 & " check namelist "//TRIM(cl_namelist)) … … 318 384 319 385 ! check domain validity 320 CALL grid_check_dom(tl_coord0, i n_imin0, in_imax0, in_jmin0, in_jmax0 )386 CALL grid_check_dom(tl_coord0, il_imin0, il_imax0, il_jmin0, il_jmax0 ) 321 387 322 388 ! compute domain 323 389 tl_dom=dom_init( tl_coord0, & 324 & i n_imin0, in_imax0,&325 & i n_jmin0, in_jmax0 )390 & il_imin0, il_imax0,& 391 & il_jmin0, il_jmax0 ) 326 392 327 393 ! add extra band (if need be) to compute interpolation … … 425 491 IF( il_attid == 0 )THEN 426 492 il_ind=var_get_index(tl_fileout%t_var(:),'longitude') 493 IF( il_ind == 0 )THEN 494 il_ind=var_get_index(tl_fileout%t_var(:),'longitude_T') 495 ENDIF 427 496 il_ew=grid_get_ew_overlap(tl_fileout%t_var(il_ind)) 428 497 IF( il_ew >= 0 )THEN … … 447 516 448 517 CALL file_clean(tl_fileout) 518 CALL var_clean_extra() 449 519 450 520 ! close log file -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_restart.f90
r6393 r7390 48 48 !> - cn_varcfg : variable configuration file 49 49 !> (see ./SIREN/cfg/variable.cfg) 50 !> - cn_dimcfg : dimension configuration file. define dimensions allowed 51 !> (see ./SIREN/cfg/dimension.cfg). 50 52 !> - cn_dumcfg : useless (dummy) configuration file, for useless 51 53 !> dimension or variable (see ./SIREN/cfg/dummy.cfg). … … 62 64 !> 63 65 !> * _vertical grid namelist (namzgr)_:<br/> 64 !> - dn_pp_to_be_computed : 65 !> - dn_ppsur : 66 !> - dn_ppa0 : 67 !> - dn_ppa1 : 68 !> - dn_ppa2 : 69 !> - dn_ppkth : 70 !> - dn_ppkth2 : 71 !> - dn_ppacr : 72 !> - dn_ppacr2 : 73 !> - dn_ppdzmin : 74 !> - dn_pphmax : 66 !> - dn_ppsur : coefficient to compute vertical grid 67 !> - dn_ppa0 : coefficient to compute vertical grid 68 !> - dn_ppa1 : coefficient to compute vertical grid 69 !> - dn_ppa2 : double tanh function parameter 70 !> - dn_ppkth : coefficient to compute vertical grid 71 !> - dn_ppkth2 : double tanh function parameter 72 !> - dn_ppacr : coefficient to compute vertical grid 73 !> - dn_ppacr2 : double tanh function parameter 74 !> - dn_ppdzmin : minimum vertical spacing 75 !> - dn_pphmax : maximum depth 75 76 !> - in_nlevel : number of vertical level 76 77 !> 78 !> @note If ppa1 and ppa0 and ppsur are undefined 79 !> NEMO will compute them from ppdzmin , pphmax, ppkth, ppacr 80 !> 77 81 !> * _partial step namelist (namzps)_:<br/> 78 !> - dn_e3zps_min : 79 !> - dn_e3zps_rat : 82 !> - dn_e3zps_min : minimum thickness of partial step level (meters) 83 !> - dn_e3zps_rat : minimum thickness ratio of partial step level 80 84 !> 81 85 !> * _variable namelist (namvar)_:<br/> … … 158 162 !> @date September, 2015 159 163 !> - manage useless (dummy) variable, attributes, and dimension 164 !> @date October, 2016 165 !> - dimension to be used select from configuration file 166 !> 167 !> @todo 168 !> - rewrite using meshmask instead of bathymetry and coordinates files 160 169 !> 161 170 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 196 205 INTEGER(i4) :: il_status 197 206 INTEGER(i4) :: il_fileid 207 INTEGER(i4) :: il_attid 198 208 INTEGER(i4) :: il_nvar 199 INTEGER(i4) :: il_attid200 209 INTEGER(i4) :: il_imin1 201 210 INTEGER(i4) :: il_imax1 … … 249 258 250 259 ! namcfg 251 CHARACTER(LEN=lc) :: cn_varcfg = 'variable.cfg' 252 CHARACTER(LEN=lc) :: cn_dumcfg = 'dummy.cfg' 260 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 261 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 262 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 253 263 254 264 ! namcrs … … 262 272 263 273 !namzgr 264 REAL(dp) :: dn_pp_to_be_computed = 0._dp265 274 REAL(dp) :: dn_ppsur = -3958.951371276829_dp 266 275 REAL(dp) :: dn_ppa0 = 103.953009600000_dp … … 304 313 NAMELIST /namcfg/ & !< configuration namelist 305 314 & cn_varcfg, & !< variable configuration file 315 & cn_dimcfg, & !< dimension configuration file 306 316 & cn_dumcfg !< dummy configuration file 307 317 … … 309 319 & cn_coord0, & !< coordinate file 310 320 & in_perio0 !< periodicity index 311 321 312 322 NAMELIST /namfin/ & !< fine grid namelist 313 323 & cn_coord1, & !< coordinate file … … 316 326 317 327 NAMELIST /namzgr/ & 318 & dn_pp_to_be_computed, &319 328 & dn_ppsur, & 320 329 & dn_ppa0, & … … 336 345 & cn_varfile, & !< list of variable file 337 346 & cn_varinfo !< list of variable and interpolation method to be used. 338 347 339 348 NAMELIST /namnst/ & !< nesting namelist 340 349 & in_rhoi, & !< refinement factor in i-direction … … 387 396 CALL var_def_extra(TRIM(cn_varcfg)) 388 397 398 ! get dimension allowed 399 CALL dim_def_extra(TRIM(cn_dimcfg)) 400 389 401 ! get dummy variable 390 402 CALL var_get_dummy(TRIM(cn_dumcfg)) … … 402 414 ! match variable with file 403 415 tl_multi=multi_init(cn_varfile) 404 416 405 417 READ( il_fileid, NML = namnst ) 406 418 READ( il_fileid, NML = namout ) … … 592 604 !- check grid coincidence 593 605 IF( ll_sameGrid )THEN 606 il_rho(:)=1 594 607 CALL grid_check_coincidence( tl_mpp, tl_coord1, & 595 608 & il_imin1, il_imax1, & … … 896 909 CALL mpp_clean(tl_mppout) 897 910 CALL mpp_clean(tl_coord1) 911 CALL var_clean_extra() 898 912 899 913 ! close log file … … 1200 1214 & tl_depth%d_value(:,:,:,:) ) )THEN 1201 1215 1202 CALL logger_warn("CREATE BOUNDARY: depth value from "//&1216 CALL logger_warn("CREATE RESTART: depth value from "//& 1203 1217 & TRIM(td_mpp%c_name)//" not conform "//& 1204 1218 & " to those from former file(s).") -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/dimension.f90
r6393 r7390 156 156 !> @date Spetember, 2015 157 157 !> - manage useless (dummy) dimension 158 !> @date October, 2016 159 !> - dimension allowed read in configuration file 158 160 !> 159 161 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 171 173 172 174 PRIVATE :: cm_dumdim !< dummy dimension array 175 PRIVATE :: cm_dimX !< x dimension array 176 PRIVATE :: cm_dimY !< y dimension array 177 PRIVATE :: cm_dimZ !< z dimension array 178 PRIVATE :: cm_dimT !< t dimension array 173 179 174 180 ! function and subroutine … … 188 194 PUBLIC :: dim_get_dummy !< fill dummy dimension array 189 195 PUBLIC :: dim_is_dummy !< check if dimension is defined as dummy dimension 196 PUBLIC :: dim_def_extra !< read dimension configuration file, and save dimension allowed. 190 197 191 198 PRIVATE :: dim__reshape_2xyzt_dp ! reshape real(8) 4D array to ('x','y','z','t') … … 203 210 PRIVATE :: dim__copy_unit ! copy dimension structure 204 211 PRIVATE :: dim__copy_arr ! copy array of dimension structure 212 PRIVATE :: dim__is_allowed 205 213 206 214 TYPE TDIM !< dimension structure … … 215 223 END TYPE 216 224 217 CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumdim !< dummy dimension 225 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumdim !< dummy dimension 226 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimX !< x dimension 227 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimY !< y dimension 228 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimZ !< z dimension 229 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimT !< t dimension 218 230 219 231 INTERFACE dim_print … … 587 599 cl_name=fct_lower(cd_name) 588 600 589 IF( TRIM(cl_name) == 'x')THEN601 IF( dim__is_allowed(TRIM(cl_name), cm_dimX(:)) )THEN 590 602 dim_init%c_sname='x' 591 ELSEIF( TRIM(cl_name) == 'y')THEN603 ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimY(:)) )THEN 592 604 dim_init%c_sname='y' 593 ELSEIF( TRIM(cl_name)== 'z' .OR. & 594 & INDEX(cl_name,'depth')/=0 )THEN 605 ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimZ(:)) )THEN 595 606 dim_init%c_sname='z' 596 ELSEIF( TRIM(cl_name)== 't' .OR. & 597 & INDEX(cl_name,'time')/=0 )THEN 607 ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimT(:)) )THEN 598 608 dim_init%c_sname='t' 599 ENDIF 609 ELSE 610 CALL logger_warn("DIM INIT: "//TRIM(cd_name)//& 611 " not allowed.") 612 ENDIF 600 613 601 614 ENDIF … … 1430 1443 ! loop indices 1431 1444 ! namelist 1432 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumvar1433 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumdim1434 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumatt1445 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 1446 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 1447 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 1435 1448 1436 1449 !---------------------------------------------------------------- … … 1493 1506 1494 1507 dim_is_dummy=.FALSE. 1495 DO ji=1,ip_maxdum 1508 DO ji=1,ip_maxdumcfg 1496 1509 IF( fct_lower(td_dim%c_name) == fct_lower(cm_dumdim(ji)) )THEN 1497 1510 dim_is_dummy=.TRUE. … … 1501 1514 1502 1515 END FUNCTION dim_is_dummy 1516 !------------------------------------------------------------------- 1517 !> @brief This subroutine read dimension configuration file, 1518 !> and fill array of dimension allowed. 1519 !> 1520 !> @author J.Paul 1521 !> @date Ocotber, 2016 - Initial Version 1522 ! 1523 !> @param[in] cd_file input file (dimension configuration file) 1524 !------------------------------------------------------------------- 1525 SUBROUTINE dim_def_extra( cd_file ) 1526 IMPLICIT NONE 1527 1528 ! Argument 1529 CHARACTER(LEN=*), INTENT(IN) :: cd_file 1530 1531 ! local variable 1532 INTEGER(i4) :: il_fileid 1533 INTEGER(i4) :: il_status 1534 1535 LOGICAL :: ll_exist 1536 1537 ! loop indices 1538 ! namelist 1539 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimX = '' 1540 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimY = '' 1541 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimZ = '' 1542 CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimT = '' 1543 1544 !---------------------------------------------------------------- 1545 NAMELIST /namdim/ & !< dimension namelist 1546 & cn_dimX, & !< x dimension name allowed 1547 & cn_dimY, & !< y dimension name allowed 1548 & cn_dimZ, & !< z dimension name allowed 1549 & cn_dimT !< t dimension name allowed 1550 1551 !---------------------------------------------------------------- 1552 1553 ! init 1554 cm_dimX(:)='' 1555 cm_dimY(:)='' 1556 cm_dimZ(:)='' 1557 cm_dimT(:)='' 1558 1559 ! read config variable file 1560 INQUIRE(FILE=TRIM(cd_file), EXIST=ll_exist) 1561 IF( ll_exist )THEN 1562 1563 il_fileid=fct_getunit() 1564 1565 OPEN( il_fileid, FILE=TRIM(cd_file), & 1566 & FORM='FORMATTED', & 1567 & ACCESS='SEQUENTIAL', & 1568 & STATUS='OLD', & 1569 & ACTION='READ', & 1570 & IOSTAT=il_status) 1571 CALL fct_err(il_status) 1572 IF( il_status /= 0 )THEN 1573 CALL logger_fatal("DIM GET DUMMY: opening "//TRIM(cd_file)) 1574 ENDIF 1575 1576 READ( il_fileid, NML = namdim ) 1577 cm_dimX(:)=cn_dimX(:) 1578 cm_dimY(:)=cn_dimY(:) 1579 cm_dimZ(:)=cn_dimZ(:) 1580 cm_dimT(:)=cn_dimT(:) 1581 1582 CLOSE( il_fileid ) 1583 1584 ELSE 1585 1586 CALL logger_fatal("DIM DEF EXTRA: can't find configuration"//& 1587 & " file "//TRIM(cd_file)) 1588 1589 ENDIF 1590 1591 END SUBROUTINE dim_def_extra 1592 !------------------------------------------------------------------- 1593 !> @brief This function check if dimension is allowed, i.e defined 1594 !> in dimension configuraton file 1595 !> 1596 !> @author J.Paul 1597 !> @date OCTOber, 2016 - Initial Version 1598 ! 1599 !> @param[in] cd_name dimension name 1600 !> @param[in] cd_dim array dimension name allowed 1601 !> @return true if dimension is allowed 1602 !------------------------------------------------------------------- 1603 FUNCTION dim__is_allowed(cd_name, cd_dim) 1604 IMPLICIT NONE 1605 1606 ! Argument 1607 CHARACTER(LEN=*), INTENT(IN) :: cd_name 1608 CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_dim 1609 1610 ! function 1611 LOGICAL :: dim__is_allowed 1612 1613 ! loop indices 1614 INTEGER(i4) :: ji 1615 !---------------------------------------------------------------- 1616 1617 dim__is_allowed=.FALSE. 1618 ji=1 1619 DO WHILE( TRIM(cd_dim(ji)) /= '' ) 1620 IF( TRIM(fct_lower(cd_name)) == TRIM(fct_lower(cd_dim(ji))) )THEN 1621 dim__is_allowed=.TRUE. 1622 EXIT 1623 ENDIF 1624 ji=ji+1 1625 ENDDO 1626 1627 END FUNCTION dim__is_allowed 1628 1503 1629 END MODULE dim 1504 1630 -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/1_install.md
r6393 r7390 20 20 <b> 21 21 - @ref index 22 - @ref md_ docsrc_2_quickstart23 - @ref md_ docsrc_3_support_bug24 - @ref md_ docsrc_4_codingRules25 - @ref md_ docsrc_5_changeLog22 - @ref md_src_docsrc_2_quickstart 23 - @ref md_src_docsrc_3_support_bug 24 - @ref md_src_docsrc_4_codingRules 25 - @ref md_src_docsrc_5_changeLog 26 26 - @ref todo 27 27 </b> -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md
r6393 r7390 7 7 Actually SIREN creates all the input files you need to run a NEMO regional configuration.<br/> 8 8 9 SIREN is composed of a set of 5Fortran programs :9 SIREN is composed of a set of 6 Fortran programs : 10 10 <ul> 11 11 <li>create_coord.f90 to create regional grid coordinates.</li> … … 16 16 This break may cause inconsistency between forcing fields at boundary and regional fields. 17 17 </li> 18 <li>create_meshmask.f90 to create meshmask or domain_cfg file(s) which contain(s) all the ocean domain informations.</li> 18 19 <li>create_restart.f90 to create initial state file from coarse grid restart 19 20 or standard outputs. … … 35 36 Here after we briefly describe how to use each programs, 36 37 and so how to create your own regional configuration. 37 @note A set of GLORYS files (global reanalysis on *ORCA025* 38 grid), as well as examples of namelists are available in dods repository.<br/> 39 You could create and forced a first release of your own regional configuration, 40 with those files. 38 @note As demonstrator for a first start a set of GLORYS files (global reanalysis on *ORCA025* grid), as well as examples of namelists are available [here](https://cloud.mercator-ocean.fr/public.php?service=files&t=acf44730538cdda0da548ffc5f99fb55). 39 41 40 <!-- ###################################################################### --> 42 41 # Create coordinates file # {#coord} … … 61 60 &namcfg 62 61 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 62 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 63 63 / 64 64 … … 92 92 empty, as done here.<br/> This will create a log file named *create_coord.log* 93 93 94 The **namcfg** sub-namelist defines where found SIREN configuration file .<br/>95 Thisconfiguration file defines standard name, default interpolation method,94 The **namcfg** sub-namelist defines where found SIREN configuration files.<br/> 95 - The variable configuration file defines standard name, default interpolation method, 96 96 axis,... to be used for some known variables.<br/> 97 97 Obviously, you could add other variables to those already list, in this file. 98 99 @note You could find the generic version of *variable.cfg* in the directory *NEMOGCM/TOOLS/SIREN/cfg*. 98 - The dimension configuration file defines dimensions allowed. 99 100 @note You could find the generic version of those configuration files in the directory *NEMOGCM/TOOLS/SIREN/cfg*. 100 101 101 102 The **namcrs** sub-namelist set parameters of the wide 102 coordinates file, <br/>as path to find it, and NEMO periodicity of the wide grid.<br/>103 coordinates file, as path to find it, and NEMO periodicity of the wide grid.<br/> 103 104 104 105 @note the NEMO periodicity could be choose between 0 to 6: … … 121 122 example: ORCA05</dd> 122 123 </dl> 123 @sa For more information see @ref md_ docsrc_6_perio124 @sa For more information see @ref md_src_docsrc_6_perio 124 125 </dd> 125 126 </dl> … … 150 151 ~~~~~~~~~~~ 151 152 @image html grid_zoom_60.png 152 @image latex grid_zoom_40.png 153 <center>@image latex grid_zoom_40.png 154 </center> 153 155 <!-- @note ghost cells all around the grid are not shown here. --> 154 156 … … 167 169 ~~~~~~~~~~~ 168 170 @image html grid_glob_over_30.png 169 @image latex grid_glob_over_20.png 171 <center>@image latex grid_glob_over_20.png 172 </center> 170 173 <!-- @note in blue, the east-west overlap band of ORCA grid. --> 171 174 … … 184 187 ~~~~~~~~~~~ 185 188 @image html grid_glob_band_30.png 186 @image latex grid_glob_band_20.png 189 <center>@image latex grid_glob_band_20.png 190 </center> 187 191 188 192 </ul> … … 217 221 &namcfg 218 222 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 223 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 219 224 / 220 225 … … 251 256 coordinates file.<br/> 252 257 @note in all SIREN namelist: <br/> 253 0referred to the coarse/wide grid.<br/>254 1referred to the fine grid.258 **0** referred to the coarse/wide grid.<br/> 259 **1** referred to the fine grid. 255 260 256 261 In the same way, the **namfin** sub-namelist set parameters of the fine 257 262 coordinates file.<br/> 258 263 @note in this namelist example, there is no need to set the variable *in_perio1* to define the NEMO 259 periodicity of the fine grid. <br/> Indeed, if this variable is not inform, SIREN tries to read it in the attributes of the file.<br/>260 So if you created the fine coordinates with SIREN, you do not have to264 periodicity of the fine grid. Indeed, if this variable is not inform, SIREN tries to read it 265 in the global attributes of the file. So if you created the fine coordinates with SIREN, you do not have to 261 266 fill it. In other case, you should add it to the namelist. 262 267 … … 298 303 # Merge bathymetry file # {#merge} 299 304 300 The Bathymetry you build differsfrom the wider one.<br/>305 The Bathymetry you build, may differ from the wider one.<br/> 301 306 To avoid issue with boundaries forcing fields, you should merge fine and coarse Bathymetry on boundaries.<br/> 302 307 SIREN allows you to do this.<br/> … … 314 319 &namcfg 315 320 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 321 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 316 322 / 317 323 … … 350 356 351 357 The **nambdy** sub-namelist defines the subdomain boundaries.<br/> 352 By default SIREN tries to create boundaries for each side. Boundary exist if there is at least one sea point on the second row of each side.<br/> 353 So you could let this namelist empty. 354 358 By default SIREN tries to create boundaries for each side. Boundary exist if there is at least one sea point on the second row of each side. So you could let this namelist empty. 355 359 @sa For more information about boundaries, see @ref boundary 356 360 … … 359 363 @sa For more information about how to merge bathymetry, see 360 364 merge_bathy.f90 365 366 <!-- ###################################################################### --> 367 # Create meshmask (ocean domain informations) # {#meshmask} 368 369 370 Depending on the vertical grid you choose to use, NEMO may not see the bathymetry exactly as you defined it just before. To get the ocean domain informations as seen by NEMO, SIREN allows you to create the meshmask file(s) which contain(s) all those informations.<br/> 371 Morevoer SIREN allows you to create the *domain_cfg* file which is the new input file for NEMO (release 3.7 and upper).<br/> 372 373 To create the meshmask file(s), you have to run : 374 ~~~~~~~~~~~~~~~~~~ 375 ./SIREN/create_meshmask.exe create_meshmask.nam 376 ~~~~~~~~~~~~~~~~~~ 377 378 Here after is an example of namelist for *create_meshmask.exe*.<br/> 379 In this example, you create one meshmask file named *mesh_mask.nc*.<br/> 380 It uses coordinates file *coord_fine.nc* to define horizontal grid. 381 and defines z-coordinate with partial steps. 382 The minimum depth of the final Bathymetry is 10m. 383 ~~~~~~~~~~~ 384 &namlog 385 / 386 387 &namcfg 388 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 389 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 390 / 391 392 &namin 393 cn_bathy = "PATH/bathy_merged.nc" 394 cn_coord = "PATH/coord_fine.nc" 395 in_perio = 4 396 / 397 398 &namhgr 399 in_mshhgr = 0 400 / 401 402 &namzgr 403 ln_zps = .TRUE. 404 in_nlevel= 75 405 / 406 407 &namdmin 408 dn_hmin=10. 409 / 410 411 &namzco 412 dn_ppsur = -3958.951371276829 413 dn_ppa0 = 103.953009600000 414 dn_ppa1 = 2.415951269000 415 dn_ppkth = 15.351013700000 416 dn_ppacr = 7.000000000000 417 dn_ppdzmin = 6. 418 dn_pphmax = 5750. 419 ln_dbletanh= .TRUE. 420 dn_ppa2 = 100.760928500000 421 dn_ppkth2 = 48.029893720000 422 dn_ppacr2 = 13.000000000000 423 / 424 425 &namzps 426 dn_e3zps_min = 25. 427 dn_e3zps_rat = 0.2 428 / 429 430 &namsco 431 / 432 433 &namlbc 434 / 435 436 &namwd 437 / 438 439 &namgrd 440 / 441 442 &namout 443 in_msh = 1 444 / 445 ~~~~~~~~~~~ 446 447 Let's get describe this namelist more accurately.<br/> 448 449 As previously, we have the **namlog** and **namcfg** describe above.<br/> 450 451 The **namin** sub-namelist defines the Bathymetry to be used. 452 Mainly SIREN need Bathymetry to create meshmask. 453 Here we also read coordinates directly on a file. 454 @note 455 1. here again you could add the *in_perio* parameter if need be i.e. if your 456 Bathymetry was not created by SIREN. 457 2. by default SIREN suppress closed sea/lake from the ORCA domain. 458 459 460 The **namhgr** sub-namelist defines the horizontal grid. 461 the type of horizontal mesh is choose between :<ul> 462 <li> in_mshhgr=0 : curvilinear coordinate on the sphere read in coordinate.nc</li> 463 <li> in_mshhgr=1 : geographical mesh on the sphere with regular grid-spacing</li> 464 <li> in_mshhgr=2 : f-plane with regular grid-spacing</li> 465 <li> in_mshhgr=3 : beta-plane with regular grid-spacing</li> 466 <li> in_mshhgr=4 : Mercator grid with T/U point at the equator</li> 467 <li> in_mshhgr=5 : beta-plane with regular grid-spacing and rotated domain (GYRE configuration)</li> 468 </ul> 469 470 The **namzgr** sub-namelist allows to choose the type of vertical grid (z-coordinate full steps, partial steps, sigma or hybrid coordinates) and the number of level. 471 472 The **namdmin** sub-namelist defines the minimum ocean depth. It could be defines in meter (>0) or in number of level (<0). 473 474 The **namzco** sub-namelist defines parameters to compute z-coordinate vertical grid (**needed for all type of vertical grid**) 475 <!-- By default, those parameters are defined the same way than in GLORYS (i.e. 75 vertical levels).<br/> --> 476 477 The **namzps** sub-namelist defines extra parameters needed to define z-coordinates partial steps. 478 479 The **namsco** sub-namelist defines extra parameters needed to define sigma or hybrid coordinates (not needed here). 480 481 <!--The **namcla** sub-namelist defines cross land advection for exchanges through some straits only used for ORCA2 (see namgrd).--> 482 483 The **namlbc** sub-namelist defines lateral boundary conditions at the coast. It is needed to modify the fmask. 484 485 The **namwd** sub-namelist defines the wetting and drying parameters if activated (see namzgr sub-namelist) 486 487 The **namgrd** sub-namelist allows to use configuration 1D or to choose vertical scale factors (e3.=dk or old definition). 488 489 Finally, this **namout** sub-namelist defines the number output file(s).<br/> 490 @note To create the domain_cfg file, you should put **in_msh=0**. 491 492 @sa For more information about how to create meshmask, see create_meshmask.f90 361 493 362 494 <!-- ###################################################################### --> … … 367 499 time step). Or you could start from "partial" information about ocean state (Temperature and Salinity for example). 368 500 369 S irenallows you to create both of those initial state.<br/>501 SIREN allows you to create both of those initial state.<br/> 370 502 To create the initial state, you have to run:<br/> 371 503 ~~~~~~~~~~~~~~~~~~ … … 374 506 375 507 Here after is an example of namelist for *create_restart.exe*.<br/> 376 In this example, you create an initial state split on 81 "processors", and named restar _out.nc.<br/>508 In this example, you create an initial state split on 81 "processors", and named restart_out.nc.<br/> 377 509 The initial state is composed of temperature and salinity refined from an extraction of GLORYS fields. 378 510 ~~~~~~~~~~~~~~~~~~ … … 382 514 &namcfg 383 515 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 516 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 384 517 / 385 518 … … 442 575 Finally, this **namout** sub-namelist defines the output files.<br/> 443 576 Here we ask for output on 81 processors, with *restart_out.nc* as file "basename".<br/> 444 So SIREN computes the optimal layout for 81 p orcessors577 So SIREN computes the optimal layout for 81 processors 445 578 available,<br/> 446 and split restart on output files named *restart_out_num.nc*, where *num* is the p orc number.579 and split restart on output files named *restart_out_num.nc*, where *num* is the proc number. 447 580 448 581 @note SIREN could also create the other fields you may need for … … 481 614 &namcfg 482 615 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 616 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 483 617 / 484 618 … … 592 726 <b> 593 727 - @ref index 594 - @ref md_ docsrc_1_install595 - @ref md_ docsrc_2_quickstart596 - @ref md_ docsrc_3_support_bug597 - @ref md_ docsrc_4_codingRules598 - @ref md_ docsrc_5_changeLog728 - @ref md_src_docsrc_1_install 729 - @ref md_src_docsrc_2_quickstart 730 - @ref md_src_docsrc_3_support_bug 731 - @ref md_src_docsrc_4_codingRules 732 - @ref md_src_docsrc_5_changeLog 599 733 - @ref todo 600 734 </b> -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/3_support_bug.md
r6393 r7390 20 20 <b> 21 21 - @ref index 22 - @ref md_ docsrc_1_install23 - @ref md_ docsrc_2_quickstart24 - @ref md_ docsrc_3_support_bug25 - @ref md_ docsrc_4_codingRules26 - @ref md_ docsrc_5_changeLog22 - @ref md_src_docsrc_1_install 23 - @ref md_src_docsrc_2_quickstart 24 - @ref md_src_docsrc_3_support_bug 25 - @ref md_src_docsrc_4_codingRules 26 - @ref md_src_docsrc_5_changeLog 27 27 - @ref todo 28 28 </b> -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/4_codingRules.md
r6393 r7390 15 15 _GET_COMMAND_ARGUMENT_.<br/> 16 16 There exist no equivalent for those Fortran 03 intrinsec functions in Fortran 17 95.<br/> At least none convenient for compilers tested (see @ref md_ docsrc_1_install).17 95.<br/> At least none convenient for compilers tested (see @ref md_src_docsrc_1_install). 18 18 19 19 # Free Form Source {#free} … … 93 93 <b> 94 94 - @ref index 95 - @ref md_ docsrc_1_install96 - @ref md_ docsrc_2_quickstart97 - @ref md_ docsrc_3_support_bug98 - @ref md_ docsrc_5_changeLog95 - @ref md_src_docsrc_1_install 96 - @ref md_src_docsrc_2_quickstart 97 - @ref md_src_docsrc_3_support_bug 98 - @ref md_src_docsrc_5_changeLog 99 99 - @ref todo 100 100 </b> -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/5_changeLog.md
r6393 r7390 3 3 @tableofcontents 4 4 5 # Release $Revision$ 6 Initial release (2016-03-17) 5 # Release $Date:: 2016-11-16 #$ ($Revision: 7235 $) 7 6 7 ## New Features 8 - create_meshmask.f90 program to create meshmask from coordinates and bathymetry files. 9 - create_meshmask.f90 allows to write domain_cfg file. 10 - merge_bathy.f90: allow to choose the number of boundary point with coarse grid value. 11 - dimension.f90: dimension allowed read in configuration file. 12 - variable.f90: allow to add scalar value. 13 - create_meshmask.f90: choose vertical scale factors (e3.=dk[depth] or old definition). 8 14 ## Changes 9 ## New Features 15 - create_coord.f90: allow to define sub domain with coarse grid indices or coordinates. 16 - grid.f90:grid__get_closest_str: add function to get closest grid point using coarse grid coordinates strucutre. 17 - iom_cdf.f90:iom_cdf__get_info: define cdf4 as cdf. 18 - variable.f90: add subroutine to clean global array of extra information, and define logical for variable to be used. 19 - create_coord.f90: dimension to be used select from configuration file. 20 - create_bathy.f90: dimension to be used select from configuration file. 21 - merge_bathy.f90: dimension to be used select from configuration file. 22 - create_boundary.f90: dimension to be used select from configuration file. 23 - create_restart.f90: dimension to be used select from configuration file. 10 24 ## Bug fixes 25 - boundary.f90:boundary_check: take into account that boundaries are compute on T point, but expressed on U,V point. 26 - grid.f90:grid__get_closest_str: use max of zero and east-west overlap instead of east-west overlap. 27 - mpp.f90: compare index to td_lay number of proc instead of td_mpp (bug fix) . 28 29 # Initial Release 2016-03-17 11 30 12 31 <HR> 13 32 <b> 14 33 - @ref index 15 - @ref md_ docsrc_1_install16 - @ref md_ docsrc_2_quickstart17 - @ref md_ docsrc_3_support_bug18 - @ref md_ docsrc_4_codingRules34 - @ref md_src_docsrc_1_install 35 - @ref md_src_docsrc_2_quickstart 36 - @ref md_src_docsrc_3_support_bug 37 - @ref md_src_docsrc_4_codingRules 19 38 - @ref todo 20 39 </b> -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/6_perio.md
r6393 r7390 6 6 <dd>ghost cells (solid walls) are imposed at all model boundaries.</dd> 7 7 @image html perio0_20.png 8 @image latex perio0_20.png 8 <center>@image latex perio0_20.png 9 </center> 9 10 <dt>cyclic east-west boundary (in_perio=1)</dt> 10 11 <dd>first and last rows are closed, whilst the first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd> 11 12 @image html perio1_20.png 12 @image latex perio1_20.png 13 <center>@image latex perio1_20.png 14 </center> 13 15 <dt>symmetric boundary condition across the equator. (in_perio=2)</dt> 14 16 <dd>last row, and first and last columns are closed. </dd> 15 17 @image html perio2_20.png 16 @image latex perio2_20.png 18 <center>@image latex perio2_20.png 19 </center> 17 20 <dt>North fold boundary with a T -point pivot (in_perio=3)</dt> 18 21 <dd>first row, and first and last columns are closed. </dd> 19 22 @image html perio3_20.png 20 @image latex perio3_20.png 23 <center>@image latex perio3_20.png 24 </center> 21 25 <dt>North fold boundary with a T -point pivot and cyclic east-west boundary (in_perio=4)</dt> 22 26 <dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one. </dd> 23 27 @image html perio4_20.png 24 @image latex perio4_20.png 28 <center>@image latex perio4_20.png 29 </center> 25 30 <dt>North fold boundary with a F -point pivot (in_perio=5)</dt> 26 31 <dd>first row, and first and last columns are closed. </dd> 27 32 @image html perio5_20.png 28 @image latex perio5_20.png 33 <center>@image latex perio5_20.png 34 </center> 29 35 <dt>North fold boundary with a F -point pivot and cyclic east-west boundary (in_perio=6)</dt> 30 36 <dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd> 31 37 @image html perio6_20.png 32 @image latex perio6_20.png 38 <center>@image latex perio6_20.png 39 </center> 33 40 </dl> 34 41 @sa For more information about NEMO periodicity, see _Model Boundary Condition_ chapter in [NEMO documentation](http://www.nemo-ocean.eu/About-NEMO/Reference-manuals)) -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/main.dox
r6393 r7390 2 2 @mainpage About 3 3 4 SIREN is a software to create regional configuration with [NEMO](http://www.nemo-ocean.eu).<br/> 5 Actually SIREN create input files needed for a basic NEMO configuration.<br/> 4 SIREN is a software to set up regional configuration with [NEMO](http://www.nemo-ocean.eu).<br/> 5 Actually SIREN creates the input files you need to run a NEMO regional configuration.<br/> 6 7 SIREN allows you to create your own regional configuration embedded in a wider one.<br/> 6 8 7 SIREN allows you to create your own regional configuration embedded in a wider one.<br/> 8 In order to help you, a set of GLORYS files (global reanalysis on ORCA025 grid), as well as examples 9 of namelists are available in dods repository. 9 To know how to install SIREN see @ref md_src_docsrc_1_install. 10 10 11 @note This software was created, and is maintain by the Configuration Manager Working Group, composed 12 of NEMO system team members. 13 14 To know how to install SIREN see @ref md_docsrc_1_install. 15 16 You could find a tutorial for a quick start with SIREN in @ref md_docsrc_2_quickstart.<br/> 11 You could find a tutorial for a quick start with SIREN in @ref md_src_docsrc_2_quickstart.<br/> 17 12 For more information about how to use each component of SIREN 18 13 - see create_coord.f90 to create fine grid coordinate file 19 14 - see create_bathy.f90 to create fine grid bathymetry 20 15 - see merge_bathy.f90 to merge fine grid bathymetry 16 - see create_meshmask.f90 to create mesh mask or domain_cfg file. 21 17 - see create_restart.f90 to create initial state file, or other fields. 22 18 - see create_boundary.F90 to create boundary condition … … 24 20 <HR> 25 21 <b> 26 - @ref md_ docsrc_1_install27 - @ref md_ docsrc_2_quickstart28 - @ref md_ docsrc_3_support_bug29 - @ref md_ docsrc_4_codingRules30 - @ref md_ docsrc_5_changeLog22 - @ref md_src_docsrc_1_install 23 - @ref md_src_docsrc_2_quickstart 24 - @ref md_src_docsrc_3_support_bug 25 - @ref md_src_docsrc_4_codingRules 26 - @ref md_src_docsrc_5_changeLog 31 27 - @ref todo 32 28 </b> -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/global.f90
r6393 r7390 67 67 68 68 INTEGER(i4) , PARAMETER :: ip_maxvar =200 !< maximum number of variable 69 INTEGER(i4) , PARAMETER :: ip_maxmtx = 100!< matrix variable maximum dimension (cf create_bathy)70 INTEGER(i4) , PARAMETER :: ip_maxseg = 50 !< maximum number of segment for each boundary69 INTEGER(i4) , PARAMETER :: ip_maxmtx =50 !< matrix variable maximum dimension (cf create_bathy) 70 INTEGER(i4) , PARAMETER :: ip_maxseg =10 !< maximum number of segment for each boundary 71 71 72 72 INTEGER(i4) , PARAMETER :: ip_nsep=2 !< number of separator listed … … 101 101 REAL(dp) , PARAMETER :: dp_fill_i4=NF90_FILL_INT !< INT fill value 102 102 REAL(dp) , PARAMETER :: dp_fill_sp=NF90_FILL_FLOAT !< real fill value 103 REAL(dp) , PARAMETER :: dp_fill=NF90_FILL_DOUBLE !< double fill value103 REAL(dp) , PARAMETER :: dp_fill=NF90_FILL_DOUBLE !< double fill value 104 104 105 105 INTEGER(i4) , PARAMETER :: ip_npoint=4 … … 112 112 113 113 114 INTEGER(i4) , PARAMETER :: ip_maxdimcfg=10 !< maximum allowed dimension in configuration file 114 115 INTEGER(i4) , PARAMETER :: ip_maxdim=4 115 116 INTEGER(i4) , PARAMETER :: jp_I=1 … … 131 132 INTEGER(i4), PARAMETER :: jp_west =4 132 133 133 INTEGER(i4) , PARAMETER :: ip_maxdum = 10 !< maximum dummy variable, dimension, attribute 134 INTEGER(i4) , PARAMETER :: ip_maxdumcfg = 10 !< maximum dummy variable, dimension, or attribute 135 !< in configuration file 134 136 135 137 END MODULE global -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/grid.f90
r6393 r7390 218 218 !> @date February, 2015 219 219 !> - add function grid_fill_small_msk to fill small domain inside bigger one 220 !> @ February, 2016220 !> @date February, 2016 221 221 !> - improve way to check coincidence (bug fix) 222 222 !> - manage grid cases for T,U,V or F point, with even or odd refinment (bug fix) 223 !> @date April, 2016 224 !> - add function to get closest grid point using coarse grid coordinates strucutre 223 225 ! 224 226 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 271 273 PRIVATE :: grid__get_coarse_index_cc ! - using coarse and fine grid array of lon,lat 272 274 275 ! return closest coarse grid point from another point 276 PRIVATE :: grid__get_closest_str ! - using coarse grid coordinates strucutre 277 PRIVATE :: grid__get_closest_arr ! - using coarse grid array of lon,lat 278 273 279 ! get offset between fine and coarse grid 274 280 PRIVATE :: grid__get_fine_offset_ff ! - using coarse and fine grid coordinates files … … 333 339 MODULE PROCEDURE grid__get_ghost_mpp 334 340 END INTERFACE grid_get_ghost 341 342 INTERFACE grid_get_closest 343 MODULE PROCEDURE grid__get_closest_str 344 MODULE PROCEDURE grid__get_closest_arr 345 END INTERFACE grid_get_closest 335 346 336 347 INTERFACE grid_get_coarse_index … … 467 478 !------------------------------------------------------------------- 468 479 !> @brief This subroutine get information about global domain, given mpp 469 !> struc utre.480 !> structure. 470 481 !> 471 482 !> @details … … 536 547 537 548 SELECT CASE(il_perio) 538 CASE(3,4)539 il_pivot=1540 CASE(5,6)541 il_pivot=0542 CASE(0,1,2)543 il_pivot=1549 CASE(3,4) 550 il_pivot=1 551 CASE(5,6) 552 il_pivot=0 553 CASE(0,1,2) 554 il_pivot=1 544 555 END SELECT 545 556 … … 1365 1376 END SELECT 1366 1377 ELSE 1378 il_perio=-1 1367 1379 ! check periodicity 1368 1380 IF(ANY(td_var%d_value( 1 ,:,1,1)/=td_var%d_fill).OR.& … … 1656 1668 !> else return the size of the ovarlap band. 1657 1669 !> East-West overlap is computed comparing longitude value of the 1658 !> South "part of the domain, to avoid north fold boundary.1670 !> South part of the domain, to avoid north fold boundary. 1659 1671 !> 1660 1672 ! … … 1663 1675 !> @date October, 2014 1664 1676 !> - work on mpp file structure instead of file structure 1677 !> @date October, 2016 1678 !> - check longitude as longname 1665 1679 !> 1666 1680 !> @param[in] td_lon longitude variable structure … … 1712 1726 ALLOCATE( dl_vare(il_jmax-il_jmin+1) ) 1713 1727 ALLOCATE( dl_varw(il_jmax-il_jmin+1) ) 1714 1728 1715 1729 dl_vare(:)=dl_value(il_east,il_jmin:il_jmax) 1716 1730 dl_varw(:)=dl_value(il_west,il_jmin:il_jmax) 1717 1718 IF( .NOT.( ALL(dl_vare(:)==td_var%d_fill) .AND. & 1719 & ALL(dl_varw(:)==td_var%d_fill) ) )THEN 1720 1721 IF( TRIM(td_var%c_stdname) == 'longitude' )THEN 1731 1732 IF( .NOT.( ALL(dl_vare(:)==td_var%d_fill) .AND. & 1733 & ALL(dl_varw(:)==td_var%d_fill) ) )THEN 1734 1735 IF( TRIM(td_var%c_stdname) == 'longitude' .OR. & 1736 & SCAN( TRIM(td_var%c_longname), 'longitude') == 0 )THEN 1722 1737 WHERE( dl_value(:,:) > 180._dp .AND. & 1723 1738 & dl_value(:,:) /= td_var%d_fill ) … … 1743 1758 ELSE 1744 1759 dl_vare(:)=dl_value(il_east-ji,il_jmin:il_jmax) 1745 1760 1746 1761 IF( ALL( dl_varw(:) == dl_vare(:) ) )THEN 1747 1762 grid__get_ew_overlap_var=ji+1 … … 1769 1784 !> else return the size of the ovarlap band. 1770 1785 !> East-West overlap is computed comparing longitude value of the 1771 !> South "part of the domain, to avoid north fold boundary.1786 !> South part of the domain, to avoid north fold boundary. 1772 1787 !> 1773 1788 !> @author J.Paul 1774 1789 !> @date October, 2014 - Initial Version 1790 !> @date October, 2016 1791 !> - check varid for longitude_T 1775 1792 !> 1776 1793 !> @param[in] td_file file structure … … 1793 1810 !---------------------------------------------------------------- 1794 1811 1795 il_varid=var_get_i ndex(td_file%t_var(:), 'longitude')1812 il_varid=var_get_id(td_file%t_var(:), 'longitude', 'longitude_T') 1796 1813 IF( il_varid /= 0 )THEN 1797 1814 ! read longitude on boundary 1798 tl_var=iom_read_var(td_file, 'longitude')1815 tl_var=iom_read_var(td_file, il_varid) 1799 1816 ELSE 1800 1817 DO ji=1,td_file%i_nvar … … 1819 1836 !> else return the size of the ovarlap band. 1820 1837 !> East-West overlap is computed comparing longitude value of the 1821 !> South "part of the domain, to avoid north fold boundary.1838 !> South part of the domain, to avoid north fold boundary. 1822 1839 !> 1823 1840 ! … … 1826 1843 !> @date October, 2014 1827 1844 !> - work on mpp file structure instead of file structure 1845 !> @date October, 2016 1846 !> - check varid for longitude_T 1828 1847 !> 1829 1848 !> @param[in] td_mpp mpp structure … … 1850 1869 1851 1870 ! read longitude on boundary 1852 il_varid=var_get_i ndex(td_mpp%t_proc(1)%t_var(:),'longitude')1871 il_varid=var_get_id(td_mpp%t_proc(1)%t_var(:),'longitude', 'longitude_T') 1853 1872 IF( il_varid /= 0 )THEN 1854 tl_var=iom_mpp_read_var(td_mpp, 'longitude')1873 tl_var=iom_mpp_read_var(td_mpp, il_varid) 1855 1874 ELSE 1856 1875 DO ji=1,td_mpp%t_proc(1)%i_nvar … … 1866 1885 grid__get_ew_overlap_mpp=il_ew 1867 1886 ENDIF 1868 1869 1887 1870 1888 ! clean … … 3020 3038 !> 3021 3039 !> @author J.Paul 3040 !> @date April, 2016 - Initial Version 3041 !> @date October, 2016 3042 !> - use max of zero and east-west overlap instead of east-west overlap 3043 !> 3044 !> @param[in] td_coord0 coarse grid coordinate mpp structure 3045 !> @param[in] dd_lon1 fine grid longitude 3046 !> @param[in] dd_lat1 fine grid latitude 3047 !> @param[in] cd_pos relative position of grid point from point 3048 !> @param[in] dd_fill fill value 3049 !> @return coarse grid indices of closest point of fine grid point 3050 !------------------------------------------------------------------- 3051 FUNCTION grid__get_closest_str( td_coord0, dd_lon1, dd_lat1, cd_pos, dd_fill ) & 3052 & RESULT(id_res) 3053 3054 IMPLICIT NONE 3055 ! Argument 3056 TYPE(TMPP ) , INTENT(IN) :: td_coord0 3057 REAL(dp), INTENT(IN) :: dd_lon1 3058 REAL(dp), INTENT(IN) :: dd_lat1 3059 CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: cd_pos 3060 REAL(dp), INTENT(IN), OPTIONAL :: dd_fill 3061 3062 ! function 3063 INTEGER(i4), DIMENSION(2) :: id_res 3064 3065 ! local variable 3066 CHARACTER(LEN=lc) :: cl_point 3067 CHARACTER(LEN=lc) :: cl_name 3068 3069 INTEGER(i4) :: il_ind 3070 INTEGER(i4) :: il_ew 3071 3072 REAL(dp) , DIMENSION(:,:), ALLOCATABLE :: dl_lon0 3073 REAL(dp) , DIMENSION(:,:), ALLOCATABLE :: dl_lat0 3074 3075 TYPE(TVAR) :: tl_lon0 3076 TYPE(TVAR) :: tl_lat0 3077 TYPE(TMPP) :: tl_coord0 3078 !---------------------------------------------------------------- 3079 3080 id_res(:)=-1 3081 cl_point='T' 3082 3083 ! copy structure 3084 tl_coord0=mpp_copy(td_coord0) 3085 3086 IF( .NOT. ASSOCIATED(tl_coord0%t_proc) )THEN 3087 3088 CALL logger_error("GRID GET CLOSEST: decompsition of mpp "//& 3089 & "file "//TRIM(tl_coord0%c_name)//" not defined." ) 3090 3091 ELSE 3092 3093 ! open mpp files 3094 CALL iom_mpp_open(tl_coord0) 3095 3096 ! read coarse longitue and latitude 3097 WRITE(cl_name,*) 'longitude_'//TRIM(cl_point) 3098 il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name) 3099 IF( il_ind == 0 )THEN 3100 CALL logger_warn("GRID GET CLOSEST: no variable "//& 3101 & TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". & 3102 & try to use longitude.") 3103 WRITE(cl_name,*) 'longitude' 3104 ENDIF 3105 tl_lon0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 3106 3107 WRITE(cl_name,*) 'latitude_'//TRIM(cl_point) 3108 il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name) 3109 IF( il_ind == 0 )THEN 3110 CALL logger_warn("GRID GET CLOSEST: no variable "//& 3111 & TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". & 3112 & try to use latitude.") 3113 WRITE(cl_name,*) 'latitude' 3114 ENDIF 3115 tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 3116 3117 ! close mpp files 3118 CALL iom_mpp_close(tl_coord0) 3119 3120 il_ew=MAX(0,tl_coord0%i_ew) 3121 ALLOCATE(dl_lon0(tl_coord0%t_dim(jp_I)%i_len-il_ew, & 3122 & tl_coord0%t_dim(jp_J)%i_len) ) 3123 ALLOCATE(dl_lat0(tl_coord0%t_dim(jp_I)%i_len-il_ew, & 3124 & tl_coord0%t_dim(jp_J)%i_len) ) 3125 3126 dl_lon0(:,:)=tl_lon0%d_value(il_ew+1:,:,1,1) 3127 dl_lat0(:,:)=tl_lat0%d_value(il_ew+1:,:,1,1) 3128 3129 id_res(:)=grid_get_closest( dl_lon0, dl_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 3130 3131 DEALLOCATE(dl_lon0, dl_lat0) 3132 CALL var_clean(tl_lon0) 3133 CALL var_clean(tl_lat0) 3134 CALL mpp_clean(tl_coord0) 3135 3136 ENDIF 3137 3138 END FUNCTION grid__get_closest_str 3139 !------------------------------------------------------------------- 3140 !> @brief This function return grid indices of the closest point 3141 !> from point (lon1,lat1) 3142 !> 3143 !> @details 3144 !> 3145 !> @note overlap band should have been already removed from coarse grid array 3146 !> of longitude and latitude, before running this function 3147 !> 3148 !> if you add cd_pos argument, you could choice to return closest point at 3149 !> - lower left (ll) of the point 3150 !> - lower right (lr) of the point 3151 !> - upper left (ul) of the point 3152 !> - upper right (ur) of the point 3153 !> - lower (lo) of the point 3154 !> - upper (up) of the point 3155 !> - left (le) of the point 3156 !> - right (ri) of the point 3157 !> 3158 !> @author J.Paul 3022 3159 !> @date November, 2013 - Initial Version 3023 3160 !> @date February, 2015 … … 3034 3171 !> @return coarse grid indices of closest point of fine grid point 3035 3172 !------------------------------------------------------------------- 3036 FUNCTION grid_ get_closest( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill )3173 FUNCTION grid__get_closest_arr( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 3037 3174 IMPLICIT NONE 3038 3175 ! Argument … … 3045 3182 3046 3183 ! function 3047 INTEGER(i4), DIMENSION(2) :: grid_ get_closest3184 INTEGER(i4), DIMENSION(2) :: grid__get_closest_arr 3048 3185 3049 3186 ! local variable … … 3261 3398 END SELECT 3262 3399 ENDIF 3263 grid_ get_closest(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE)3264 3265 grid_ get_closest(1)=grid_get_closest(1)+il_iinf-13266 grid_ get_closest(2)=grid_get_closest(2)+il_jinf-13400 grid__get_closest_arr(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE) 3401 3402 grid__get_closest_arr(1)=grid__get_closest_arr(1)+il_iinf-1 3403 grid__get_closest_arr(2)=grid__get_closest_arr(2)+il_jinf-1 3267 3404 3268 3405 DEALLOCATE( dl_dist ) 3269 3406 DEALLOCATE( dl_lon0 ) 3270 3407 3271 END FUNCTION grid_ get_closest3408 END FUNCTION grid__get_closest_arr 3272 3409 !------------------------------------------------------------------- 3273 3410 !> @brief This function compute the distance between a point A and grid points. … … 3475 3612 ENDIF 3476 3613 tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 3477 3614 3478 3615 ! close mpp files 3479 3616 CALL iom_mpp_close(tl_coord0) … … 4647 4784 4648 4785 IF( ll_even )THEN 4786 4649 4787 ! look for variable value on domain for F point 4650 4788 il_ind=var_get_index(tl_coord0%t_proc(1)%t_var(:), 'longitude_F') -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/iom.f90
r5617 r7390 157 157 !> @author J.Paul 158 158 !> @date November, 2013 - Initial Version 159 ! 159 !> 160 160 !> @param[inout] td_file file structure 161 161 !------------------------------------------------------------------- -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90
r6393 r7390 316 316 !> @author J.Paul 317 317 !> @date November, 2013 - Initial Version 318 !> @date October, 2016 319 !> - define cdf4 as cdf. 318 320 ! 319 321 !> @param[inout] td_file file structure … … 340 342 td_file%c_type='cdf' 341 343 CASE(nf90_format_netcdf4, nf90_format_netcdf4_classic) 342 td_file%c_type='cdf4' 344 !td_file%c_type='cdf4' 345 td_file%c_type='cdf' 343 346 END SELECT 344 347 … … 351 354 !> reorder dimension to ('x', 'y', 'z', 't'). 352 355 !> The dimension structure inside file structure is then completed. 353 ! 354 !> @author J.Paul 355 !> @date November, 2013 - Initial Version 356 ! 356 !> 357 !> @author J.Paul 358 !> @date November, 2013 - Initial Version 359 !> @date October, 2016 360 !> - check unknown dimension 361 !> 357 362 !> @param[inout] td_file file structure 358 363 !------------------------------------------------------------------- … … 375 380 376 381 IF( td_file%i_ndim > 0 )THEN 382 377 383 ii=1 378 384 DO ji = 1, td_file%i_ndim 379 385 ! read dimension information 380 386 tl_dim=iom_cdf_read_dim( td_file, ji) 381 IF( .NOT. dim_is_dummy(tl_dim) )THEN 387 ! sname == 'u' if dimension is unknown (not to be used) 388 IF( TRIM(tl_dim%c_sname) /= 'u' )THEN 382 389 IF( ii > ip_maxdim )THEN 383 390 CALL logger_fatal("IOM CDF OPEN: too much dimension "//& 384 & "to be read. you should remove dummy dimension using"//&391 & "to be read. you could choose dimension to be used. see "//& 385 392 & " configuration file") 386 393 ENDIF … … 395 402 & " IOM CDF GET FILE DIM: there is no unlimited dimension in file "//& 396 403 & TRIM(td_file%c_name)) 397 ELSE398 td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE.404 !ELSE 405 ! td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE. 399 406 ENDIF 400 407 … … 466 473 !> The variable structure inside file structure is then completed. 467 474 !> @note variable value are not read ! 468 ! 475 !> 469 476 !> @author J.Paul 470 477 !> @date November, 2013 - Initial Version … … 473 480 !> @date January, 2016 474 481 !> - increment n3d for 4D variable 475 ! 482 !> @date October, 2016 483 !> - check if variable to be used (variable's dimension allowed and variable 484 !> not "dummy") 485 !> 476 486 !> @param[inout] td_file file structure 477 487 !------------------------------------------------------------------- … … 501 511 il_nvar=td_file%i_nvar 502 512 ALLOCATE(tl_var(il_nvar)) 503 ii=0504 513 DO ji = 1, il_nvar 505 514 ! read variable information 506 515 tl_var(ji)=iom_cdf__read_var_meta( td_file, ji) 507 IF( .NOT. var_is_dummy(tl_var(ji)) )THEN508 ii=ii+1509 ENDIF510 516 ENDDO 511 517 512 518 ! update number of variable used 513 td_file%i_nvar= ii519 td_file%i_nvar=COUNT(tl_var(:)%l_use) 514 520 515 521 ALLOCATE(td_file%t_var(td_file%i_nvar)) … … 517 523 ii=0 518 524 DO ji = 1, il_nvar 519 IF( .NOT. var_is_dummy(tl_var(ji)))THEN525 IF( tl_var(ji)%l_use )THEN 520 526 ii=ii+1 521 527 td_file%t_var(ii)=var_copy(tl_var(ji)) … … 552 558 td_file%i_timeid=ji 553 559 ELSE 560 IF( td_file%i_timeid /= ji )THEN 561 CALL logger_warn("IOM CDF GET FILE VAR: find more "//& 562 & "than one time variable in file "//& 563 & TRIM(td_file%c_name)//". see "//& 564 & "dummy.cfg configuration file to"//& 565 & " not used dummy variables.") 566 ENDIF 554 567 il_attid=0 555 568 IF( ASSOCIATED(td_file%t_var(ii)%t_att) )THEN … … 558 571 IF( il_attid /= 0 )THEN 559 572 td_file%i_timeid=ji 560 !ELSE561 ! CALL logger_error("IOM CDF GET FILE VAR: find more "//&562 ! & "than one time variable in file "//&563 ! & TRIM(td_file%c_name) )564 573 ENDIF 565 574 ENDIF … … 652 661 & " IOM CDF READ DIM: no id associated to file "//TRIM(td_file%c_name)) 653 662 654 ELSE 663 ELSE 655 664 656 665 CALL logger_trace( & … … 1413 1422 ENDDO 1414 1423 1424 !! check if variable is dummy 1425 IF( var_is_dummy(iom_cdf__read_var_meta) )THEN 1426 iom_cdf__read_var_meta%l_use=.FALSE. 1427 ENDIF 1428 1429 !! check if all dimensions are allowed 1430 DO ji=1,il_ndim 1431 IF( ALL(td_file%t_dim(:)%i_id /= il_dimid(ji)) )THEN 1432 iom_cdf__read_var_meta%l_use=.FALSE. 1433 ENDIF 1434 ENDDO 1435 1415 1436 ! clean 1416 1437 CALL dim_clean(tl_dim(:)) … … 1484 1505 ELSE IF( id_ndim > 0 )THEN 1485 1506 1486 1487 1507 ii=1 1488 1508 DO ji = 1, id_ndim 1489 1509 1490 ! !! check no dummy dimension to be used1510 ! check if dimension to be used, is allowed 1491 1511 IF( ANY(td_file%t_dim(:)%i_id == id_dimid(ji)) )THEN 1492 1512 IF( ii > ip_maxdim )THEN … … 1500 1520 1501 1521 il_xyzt2(ii)=td_file%t_dim(id_dimid(ji))%i_xyzt2 1502 1522 1503 1523 ! read dimension information 1504 1524 tl_dim(ii) = dim_init( td_file%t_dim(il_xyzt2(ii))%c_name, & 1505 1525 & td_file%t_dim(il_xyzt2(ii))%i_len ) 1506 1526 1507 1527 ii=ii+1 1508 1528 ELSE … … 2080 2100 & 'gcost','gcosu','gcosv','gcosf', & 2081 2101 & 'gsint','gsinu','gsinv','gsinf', & 2082 & 'mbathy','misf','isf_draft', &2102 & 'mbathy','misf','isf_draft','isfdraft', & 2083 2103 & 'hbatt','hbatu','hbatv','hbatf', & 2084 2104 & 'gsigt','gsigu','gsigv','gsigf', & … … 2189 2209 CALL iom_cdf__check(il_status,"IOM CDF WRITE VAR DEF: ") 2190 2210 ENDIF 2211 CALL logger_debug("IOM CDF WRITE VAR DEF: type = "//TRIM(fct_str(tl_var%i_type))) 2191 2212 2192 2213 ! remove unuseful attribute -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/merge_bathy.f90
r6393 r7390 51 51 !> - cn_varcfg : variable configuration file 52 52 !> (see ./SIREN/cfg/variable.cfg) 53 !> - cn_dimcfg : dimension configuration file. define dimensions allowed 54 !> (see ./SIREN/cfg/dimension.cfg). 53 55 !> - cn_dumcfg : useless (dummy) configuration file, for useless 54 56 !> dimension or variable (see ./SIREN/cfg/dummy.cfg). … … 115 117 !> - cn_east : east boundary indices on fine grid<br/> 116 118 !> - cn_west : west boundary indices on fine grid<br/> 119 !> - in_ncrs : number of point(s) with coarse value save at boundaries<br/> 117 120 !> - ln_oneseg: use only one segment for each boundary or not 118 121 !> … … 130 133 !> @date September, 2015 131 134 !> - manage useless (dummy) variable, attributes, and dimension 135 !> @date October, 2016 136 !> - allow to choose the number of boundary point with coarse grid value. 137 !> - dimension to be used select from configuration file 132 138 !> 133 139 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 208 214 209 215 ! namcfg 210 CHARACTER(LEN=lc) :: cn_varcfg = 'variable.cfg' 211 CHARACTER(LEN=lc) :: cn_dumcfg = 'dummy.cfg' 216 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 217 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 218 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 212 219 213 220 ! namcrs … … 231 238 LOGICAL :: ln_east = .TRUE. 232 239 LOGICAL :: ln_west = .TRUE. 233 LOGICAL :: ln_oneseg= .TRUE.234 240 CHARACTER(LEN=lc) :: cn_north = '' 235 241 CHARACTER(LEN=lc) :: cn_south = '' 236 242 CHARACTER(LEN=lc) :: cn_east = '' 237 243 CHARACTER(LEN=lc) :: cn_west = '' 244 INTEGER(i4) :: in_ncrs = 2 245 LOGICAL :: ln_oneseg= .TRUE. 238 246 239 247 ! namout … … 248 256 NAMELIST /namcfg/ & !< config namelist 249 257 & cn_varcfg, & !< variable configuration file 258 & cn_dimcfg, & !< dimension configuration file 250 259 & cn_dumcfg !< dummy configuration file 251 260 … … 276 285 & cn_east , & !< east boundary indices on fine grid 277 286 & cn_west , & !< west boundary indices on fine grid 287 & in_ncrs, & !< number of point with coarse value save at boundaries 278 288 & ln_oneseg !< use only one segment for each boundary or not 279 289 … … 319 329 CALL var_def_extra(TRIM(cn_varcfg)) 320 330 331 ! get dimension allowed 332 CALL dim_def_extra(TRIM(cn_dimcfg)) 333 321 334 ! get dummy variable 322 335 CALL var_get_dummy(TRIM(cn_dumcfg)) … … 435 448 DO jk=1,ip_ncard 436 449 CALL merge_bathy_get_boundary(tl_bathy0, tl_bathy1, tl_bdy(jk), & 437 & il_rho(:), 450 & il_rho(:), in_ncrs, & 438 451 & dl_refined(:,:,:,:), dl_weight(:,:,:,:), & 439 452 & dl_fill) … … 621 634 DEALLOCATE(dl_weight) 622 635 CALL boundary_clean(tl_bdy(:)) 636 CALL var_clean_extra() 623 637 624 638 ! close log file … … 638 652 !> @param[in] td_bdy boundary structure 639 653 !> @param[in] id_rho array of refinement factor 654 !> @param[in] id_ncrs number of point with coarse value save at boundaries 640 655 !> @param[inout] dd_refined array of refined bathymetry 641 656 !> @param[inout] dd_weight array of weight 642 657 !> @param[in] dd_fill fillValue 643 658 !> 644 !> @todo improve boundary weight function645 659 !------------------------------------------------------------------- 646 660 SUBROUTINE merge_bathy_get_boundary( td_bathy0, td_bathy1, td_bdy, & 647 & id_rho, 661 & id_rho, id_ncrs, & 648 662 & dd_refined, dd_weight, dd_fill ) 649 663 … … 655 669 TYPE(TBDY) , INTENT(IN ) :: td_bdy 656 670 INTEGER(i4), DIMENSION(:) , INTENT(IN ) :: id_rho 671 INTEGER(i4) , INTENT(IN ) :: id_ncrs 657 672 REAL(dp) , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_refined 658 673 REAL(dp) , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_weight … … 670 685 INTEGER(i4) :: il_jmax0 671 686 687 INTEGER(i4) :: il_width 688 672 689 INTEGER(i4), DIMENSION(2,2) :: il_offset 673 690 INTEGER(i4), DIMENSION(2,2) :: il_ind … … 838 855 CASE('north') 839 856 840 ! ! npoint coarse 841 ! il_width=td_bdy%t_seg(jl)%i_width-id_npoint 842 ! ! compute "distance" 843 ! dl_tmp1d(:)=(/(ji,ji=il_width-1,1,-1),(0,ji=1,id_npoint)/) 844 ! ! compute weight on segment 845 ! dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 846 ! & (il_width) ) 847 857 858 ! save n coarse point 859 il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 848 860 ! compute "distance" 849 dl_tmp1d(:)=(/(ji -1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/)861 dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/) 850 862 851 863 ! compute weight on segment 852 864 dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 853 & (td_bdy%t_seg(jl)%i_width) ) 865 & (il_width) ) 866 854 867 855 868 ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & … … 862 875 CASE('south') 863 876 877 ! save n coarse point 878 il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 864 879 ! compute "distance" 865 dl_tmp1d(:)=(/ 0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)880 dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/) 866 881 867 882 ! compute weight on segment 868 883 dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 869 & (td_bdy%t_seg(jl)%i_width) ) 884 & (il_width) ) 885 870 886 871 887 ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & … … 878 894 CASE('east') 879 895 896 ! save n coarse point 897 il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 880 898 ! compute "distance" 881 dl_tmp1d(:)=(/(ji -1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/)899 dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/) 882 900 883 901 ! compute weight on segment 884 902 dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 885 & (td_bdy%t_seg(jl)%i_width) ) 903 & (il_width) ) 904 886 905 887 906 ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & … … 894 913 CASE('west') 895 914 915 ! save n coarse point 916 il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 896 917 ! compute "distance" 897 dl_tmp1d(:)=(/ 0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)918 dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/) 898 919 899 920 ! compute weight on segment 900 921 dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 901 & (td_bdy%t_seg(jl)%i_width) ) 922 & (il_width) ) 923 902 924 903 925 ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/mpp.f90
r6393 r7390 266 266 PRIVATE :: mpp__copy_arr ! copy array of mpp structure 267 267 PRIVATE :: mpp__get_use_unit ! get sub domains to be used (which cover "zoom domain") 268 PRIVATE :: mpp__init_mask ! initialise mpp structure, given file name268 PRIVATE :: mpp__init_mask ! initialise mpp structure, given mask array 269 269 PRIVATE :: mpp__init_var ! initialise mpp structure, given variable strcuture 270 270 PRIVATE :: mpp__init_file ! initialise a mpp structure, given file structure … … 2550 2550 !> and the number of processors following I and J. 2551 2551 !> Then the number of sea/land processors is compute with mask 2552 ! 2552 !> 2553 2553 !> @author J.Paul 2554 2554 !> @date October, 2015 - Initial version 2555 ! 2555 !> @date October, 2016 2556 !> - compare index to td_lay number of proc instead of td_mpp (bug fix) 2557 !> 2556 2558 !> @param[in] td_mpp mpp strcuture 2557 2559 !> @param[in] id_mask sub domain mask (sea=1, land=0) … … 2670 2672 2671 2673 ! east boundary 2672 IF( ji == td_ mpp%i_niproc )THEN2674 IF( ji == td_lay%i_niproc )THEN 2673 2675 il_lei = td_lay%i_lci(ji,jj) 2674 2676 ELSE … … 2677 2679 2678 2680 ! north boundary 2679 IF( jj == td_ mpp%i_njproc )THEN2681 IF( jj == td_lay%i_njproc )THEN 2680 2682 il_lej = td_lay%i_lcj(ji,jj) 2681 2683 ELSE -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/phycst.f90
r6393 r7390 34 34 PUBLIC :: dp_siday !< sideral day [s] 35 35 36 REAL( wp), PUBLIC :: rday = 24.*60.*60. !: day [s]37 REAL( wp), PUBLIC :: rsiyea !: sideral year [s]38 REAL( wp), PUBLIC :: rsiday !: sideral day [s]36 REAL(dp), PUBLIC :: rday = 24.*60.*60. !: day [s] 37 REAL(dp), PUBLIC :: rsiyea !: sideral year [s] 38 REAL(dp), PUBLIC :: rsiday !: sideral day [s] 39 39 40 40 REAL(dp), PARAMETER :: dp_pi = 3.14159274101257_dp 41 REAL(dp), PARAMETER :: dp_eps = EPSILON(1._dp)41 REAL(dp), PARAMETER :: dp_eps = 0.5 * EPSILON(1._dp) 42 42 REAL(dp), PARAMETER :: dp_rearth = 6371229._dp 43 43 REAL(dp), PARAMETER :: dp_deg2rad = dp_pi/180.0 … … 45 45 46 46 REAL(dp), PARAMETER :: dp_day = 24.*60.*60. 47 REAL(dp), PARAMETER :: dp_siyea = 365.25_ wp * dp_day * &48 & 2._ wp * dp_pi / 6.283076_dp49 REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._ wp + dp_day / dp_siyea )47 REAL(dp), PARAMETER :: dp_siyea = 365.25_dp * dp_day * & 48 & 2._dp * dp_pi / 6.283076_dp 49 REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._dp + dp_day / dp_siyea ) 50 50 51 REAL(dp), PARAMETER :: dp_delta=1.e- 651 REAL(dp), PARAMETER :: dp_delta=1.e-5 52 52 REAL(dp), PARAMETER :: dp_omega= 2._dp * dp_pi / dp_siday 53 53 END MODULE phycst -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/variable.f90
r6393 r7390 34 34 !> Note:<br/> 35 35 !> - others optionals arguments could be added, see var_init. 36 !> - to put variable 0D, use td_dim with all dimension unused36 !> - to put scalar variable (OD), use td_dim with all dimension unused 37 37 !> (td_dim(:)%l_use=.FALSE.) 38 38 !> … … 267 267 !> - cd_varinfo is variable information from namelist 268 268 !> 269 !> to clean global array of variable structure:<br/> 270 !>@code 271 !> CALL var_clean_extra( ) 272 !>@endcode 273 !> 269 274 !> to check variable dimension expected, as defined in file 'variable.cfg':<br/> 270 275 !>@code … … 287 292 !> @date Spetember, 2015 288 293 !> - manage useless (dummy) variable 289 ! 294 !> @date October, 2016 295 !> - add subroutine to clean global array of extra information. 296 !> - define logical for variable to be used 297 !> 290 298 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 291 299 !---------------------------------------------------------------------- … … 337 345 PUBLIC :: var_def_extra !< read variable configuration file, and save extra information. 338 346 PUBLIC :: var_chg_extra !< read variable namelist information, and modify extra information. 347 PUBLIC :: var_clean_extra !< clean gloabl array of extra information. 339 348 PUBLIC :: var_check_dim !< check variable dimension expected 340 349 PUBLIC :: var_get_dummy !< fill dummy variable array … … 416 425 TYPE(TDIM), DIMENSION(ip_maxdim) :: t_dim !< variable dimension 417 426 418 LOGICAL :: l_file = .FALSE. !< variable read in a file 427 LOGICAL :: l_file = .FALSE. !< variable read in a file 428 LOGICAL :: l_use = .TRUE. !< variable to be used 419 429 420 430 ! highlight some attributes … … 451 461 !< fill when running var_def_extra() 452 462 453 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ), SAVE :: cm_dumvar !< dummy variable463 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumvar !< dummy variable 454 464 455 465 INTERFACE var_init … … 593 603 CALL att_clean(tl_att) 594 604 ENDIF 605 606 var__copy_unit%l_file = td_var%l_file 607 var__copy_unit%l_use = td_var%l_use 595 608 596 609 ! copy highlight attribute … … 1126 1139 !> @date July, 2015 1127 1140 !> - add unit factor (to change unit) 1141 !> @date November, 2016 1142 !> - allow to add scalar value 1128 1143 !> 1129 1144 !> @param[in] cd_name variable name … … 1279 1294 dl_value(1,1,1,:) = dd_value(:) 1280 1295 ELSE 1281 CALL logger_fatal("VAR INIT: can not add value from variable "//& 1282 & TRIM(cd_name)//". invalid dimension to be used") 1296 IF( SIZE(dd_value(:)) > 1 )THEN 1297 CALL logger_fatal("VAR INIT: can not add value from variable "//& 1298 & TRIM(cd_name)//". invalid dimension to be used") 1299 ELSE 1300 dl_value(1,1,1,1) = dd_value(1) 1301 CALL logger_warn("VAR INIT: add scalar value for variable "//& 1302 & TRIM(cd_name)) 1303 1304 ENDIF 1283 1305 ENDIF 1284 1306 … … 6669 6691 ! check if variable is in array of variable structure 6670 6692 DO ji=1,il_size 6693 6671 6694 ! look for variable name 6672 6695 IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN … … 6683 6706 6684 6707 ELSE IF( PRESENT(cd_stdname) )THEN 6708 6685 6709 IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.& 6686 6710 & TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN … … 6690 6714 ENDIF 6691 6715 6716 ENDIF 6717 6692 6718 ! look for variable longname 6693 ELSEIF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.&6694 & 6719 IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 6720 & TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 6695 6721 6696 6722 var_get_index=ji 6697 6723 EXIT 6724 6725 ELSE IF( PRESENT(cd_stdname) )THEN 6726 6727 IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.& 6728 & TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 6729 6730 var_get_index=ji 6731 EXIT 6732 ENDIF 6698 6733 6699 6734 ENDIF … … 6734 6769 ! check if variable is in array of variable structure 6735 6770 DO ji=1,il_size 6771 6736 6772 ! look for variable name 6737 6773 IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN … … 6747 6783 EXIT 6748 6784 6749 ! look for variable long name 6750 ELSE IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 6751 & TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 6752 6753 var_get_id=td_var(ji)%i_id 6754 EXIT 6755 6756 ELSE IF( PRESENT(cd_stdname) )THEN 6785 ELSE IF( PRESENT(cd_stdname) )THEN 6786 6757 6787 IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.& 6758 6788 & TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN … … 6761 6791 EXIT 6762 6792 ENDIF 6793 6794 ENDIF 6795 6796 ! look for variable long name 6797 IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 6798 & TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 6799 6800 var_get_id=td_var(ji)%i_id 6801 EXIT 6802 6803 ELSE IF( PRESENT(cd_stdname) )THEN 6804 6805 IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.& 6806 & TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 6807 6808 var_get_id=td_var(ji)%i_id 6809 EXIT 6810 ENDIF 6811 6763 6812 ENDIF 6764 6813 … … 7176 7225 !------------------------------------------------------------------- 7177 7226 !> @brief 7227 !> This subroutine clean global array of variable structure 7228 !> with extra information: tg_varextra. 7229 !> 7230 !> @author J.Paul 7231 !> @date October, 2016 - Initial Version 7232 !------------------------------------------------------------------- 7233 SUBROUTINE var_clean_extra( ) 7234 IMPLICIT NONE 7235 ! Argument 7236 !---------------------------------------------------------------- 7237 7238 CALL var_clean(tg_varextra(:)) 7239 DEALLOCATE(tg_varextra) 7240 7241 END SUBROUTINE var_clean_extra 7242 !------------------------------------------------------------------- 7243 !> @brief 7178 7244 !> This subroutine read matrix value from character string in namelist 7179 !> and fill variable struc utre value.7245 !> and fill variable structure value. 7180 7246 !> 7181 7247 !> @details … … 8463 8529 ! loop indices 8464 8530 ! namelist 8465 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumvar8466 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumdim8467 CHARACTER(LEN=lc), DIMENSION(ip_maxdum ) :: cn_dumatt8531 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 8532 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 8533 CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 8468 8534 8469 8535 !---------------------------------------------------------------- … … 8526 8592 8527 8593 var_is_dummy=.FALSE. 8528 DO ji=1,ip_maxdum 8594 DO ji=1,ip_maxdumcfg 8529 8595 IF( fct_lower(td_var%c_name) == fct_lower(cm_dumvar(ji)) )THEN 8530 8596 var_is_dummy=.TRUE. -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/vgrid.f90
r6393 r7390 14 14 !> CALL vgrid_zgr_z(dd_gdepw(:), dd_gdept(:), dd_e3w(:), dd_e3t(:), 15 15 !> dd_ppkth, dd_ppkth2, dd_ppacr, dd_ppacr2, 16 !> dd_ppdzmin, dd_pphmax, dd_pp_to_be_computed,16 !> dd_ppdzmin, dd_pphmax, 17 17 !> dd_ppa0, dd_ppa1, dd_ppa2, dd_ppsur) 18 18 !> @endcode … … 26 26 !> - dd_ppdzmin see NEMO documentation 27 27 !> - dd_pphmax see NEMO documentation 28 !> - dd_pp_to_be_computed see NEMO documentation29 28 !> - dd_ppa1 see NEMO documentation 30 29 !> - dd_ppa2 see NEMO documentation … … 133 132 !> @param[in] dd_ppdzmin 134 133 !> @param[in] dd_pphmax 135 !> @param[in] dd_pp_to_be_computed136 134 !> @param[in] dd_ppa1 137 135 !> @param[in] dd_ppa2 … … 140 138 !------------------------------------------------------------------- 141 139 SUBROUTINE vgrid_zgr_z( dd_gdepw, dd_gdept, dd_e3w, dd_e3t, & 142 & dd_e3w_1d, dd_e3t_1d, &140 & dd_e3w_1d, dd_e3t_1d, & 143 141 & dd_ppkth, dd_ppkth2, dd_ppacr, dd_ppacr2, & 144 & dd_ppdzmin, dd_pphmax, dd_pp_to_be_computed,&142 & dd_ppdzmin, dd_pphmax, & 145 143 & dd_ppa0, dd_ppa1, dd_ppa2, dd_ppsur ) 146 144 IMPLICIT NONE … … 160 158 REAL(dp) , INTENT(IN ) :: dd_ppdzmin 161 159 REAL(dp) , INTENT(IN ) :: dd_pphmax 162 REAL(dp) , INTENT(IN ) :: dd_pp_to_be_computed160 REAL(dp), PARAMETER :: dp_pp_to_be_computed = NF90_FILL_DOUBLE 163 161 164 162 REAL(dp) , INTENT(IN ) :: dd_ppa0 … … 207 205 ! za0, za1, zsur are computed from ppdzmin , pphmax, ppkth, ppacr 208 206 ! 209 IF( dd_ppa1 == d d_pp_to_be_computed .AND. &210 & dd_ppa0 == d d_pp_to_be_computed .AND. &211 & dd_ppsur == d d_pp_to_be_computed ) THEN207 IF( dd_ppa1 == dp_pp_to_be_computed .AND. & 208 & dd_ppa0 == dp_pp_to_be_computed .AND. & 209 & dd_ppsur == dp_pp_to_be_computed ) THEN 212 210 dl_za1 = ( dl_zdzmin - dl_zhmax / REAL((il_jpk-1),dp) ) & 213 211 & / ( TANH((1-dl_zkth)/dl_zacr) - dl_zacr/REAL((il_jpk-1),dp) & … … 667 665 668 666 !namelist (intialise with GLORYS 75 levels parameters) 669 REAL(dp) :: dn_pp_to_be_computed = 0._dp670 667 REAL(dp) :: dn_ppsur = -3958.951371276829_dp 671 668 REAL(dp) :: dn_ppa0 = 103.9530096000000_dp … … 684 681 !---------------------------------------------------------------- 685 682 NAMELIST /namzgr/ & 686 & dn_pp_to_be_computed, &687 683 & dn_ppsur, & 688 684 & dn_ppa0, & … … 788 784 & dl_e3w_1d, dl_e3t_1d, & 789 785 & dn_ppkth, dn_ppkth2, dn_ppacr, dn_ppacr2, & 790 & dn_ppdzmin, dn_pphmax, dn_pp_to_be_computed,&786 & dn_ppdzmin, dn_pphmax, & 791 787 & dn_ppa0, dn_ppa1, dn_ppa2, dn_ppsur ) 792 788 -
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/templates/merge_bathy.nam
r6393 r7390 34 34 cn_east= 35 35 cn_west= 36 in_ncrs= 36 37 ln_oneseg= 37 38 /
Note: See TracChangeset
for help on using the changeset viewer.