Changeset 8862
- Timestamp:
- 2017-11-30T16:58:49+01:00 (7 years ago)
- Location:
- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN
- Files:
-
- 1 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/README
r6467 r8862 3 3 (http://www.stack.nl/~dimitri/doxygen/index.html version 1.8.3.1 or upper) 4 4 then 5 open ./TOOLS/SIREN/doc/html/index.html in your web browser 5 open ./TOOLS/SIREN/doc/html/index.html in your web browser 6 6 or 7 run ./TOOLS/SIREN/doc/latex/gmakeand open ./TOOLS/SIREN/doc/latex/refman.pdf7 run gmake in ./TOOLS/SIREN/doc/latex directory and open ./TOOLS/SIREN/doc/latex/refman.pdf -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/dummy.cfg
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/attribute.f90
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_bathy.f90
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_boundary.F90
r6392 r8862 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). … … 161 164 !> - cn_north='index1(width),first1:last1|index2,first2:last2' 162 165 !> \image html boundary_50.png 163 !> \image latex boundary_50.png 166 !> <center>\image latex boundary_50.png 167 !> </center> 164 168 !> - cn_south : south boundary indices on fine grid 165 169 !> - cn_east : east boundary indices on fine grid … … 198 202 !> @date January, 2016 199 203 !> - same process use for variable extracted or interpolated from input file. 204 !> @date October, 2016 205 !> - dimension to be used select from configuration file 206 !> 207 !> @todo 208 !> - rewitre using meshmask instead of bathymetry and coordinates files. 200 209 !> 201 210 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 383 392 384 393 ! namcfg 385 CHARACTER(LEN=lc) :: cn_varcfg = 'variable.cfg' 386 CHARACTER(LEN=lc) :: cn_dumcfg = 'dummy.cfg' 394 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 395 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 396 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 387 397 388 398 ! namcrs … … 445 455 NAMELIST /namcfg/ & !< config namelist 446 456 & cn_varcfg, & !< variable configuration file 457 & cn_dimcfg, & !< dimension configuration file 447 458 & cn_dumcfg !< dummy configuration file 448 459 … … 527 538 CALL var_def_extra(TRIM(cn_varcfg)) 528 539 540 ! get dimension allowed 541 CALL dim_def_extra(TRIM(cn_dimcfg)) 542 529 543 ! get dummy variable 530 544 CALL var_get_dummy(TRIM(cn_dumcfg)) … … 761 775 ENDIF 762 776 ENDDO 763 777 764 778 ! clean 765 779 CALL var_clean(tl_var1) … … 879 893 CALL dom_del_extra( tl_segvar1(jvar+jj,jk,jl), & 880 894 & tl_dom1 ) 895 881 896 ! clean extra point information on coarse grid domain 882 897 CALL dom_clean_extra( tl_dom0 ) … … 1151 1166 CALL mpp_clean(tl_coord1) 1152 1167 CALL mpp_clean(tl_coord0) 1168 CALL var_clean_extra() 1153 1169 1154 1170 CALL multi_clean(tl_multi) … … 1382 1398 CALL extrap_fill_value( td_var ) 1383 1399 1384 ! interpolate Bathymetry1400 ! interpolate variable 1385 1401 CALL interp_fill_value( td_var, id_rho(:), & 1386 1402 & id_offset=id_offset(:,:) ) -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_coord.f90
r6392 r8862 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. 81 !> @note if coordinates defined, SIREN does not take into account indices. 82 !> 78 83 !> - in_imin0 : i-direction lower left point indice 79 84 !> of coarse grid subdomain to be used … … 84 89 !> - in_jmax0 : j-direction upper right point indice 85 90 !> of coarse grid subdomain to be used 91 !> - rn_lonmin0 : lower left longitude of coarse grid subdomain to be used 92 !> - rn_lonmax0 : upper right longitude of coarse grid subdomain to be used 93 !> - rn_latmin0 : lower left latitude of coarse grid subdomain to be used 94 !> - rn_latmax0 : upper right latitude of coarse grid subdomain to be used 86 95 !> - in_rhoi : refinement factor in i-direction 87 96 !> - in_rhoj : refinement factor in j-direction<br/> 88 97 !> 89 98 !> \image html grid_zoom_40.png 90 !> \image latex grid_zoom_40.png 99 !> <center> \image latex grid_zoom_40.png 100 !> </center> 91 101 !> 92 102 !> * _output namelist (namout)_: … … 102 112 !> @date September, 2015 103 113 !> - manage useless (dummy) variable, attributes, and dimension 114 !> @date September, 2016 115 !> - allow to use coordinate to define subdomain 116 !> @date October, 2016 117 !> - dimension to be used select from configuration file 104 118 !> 105 119 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 139 153 INTEGER(i4) :: il_nvar 140 154 INTEGER(i4) :: il_ew 155 INTEGER(i4) :: il_imin0 156 INTEGER(i4) :: il_imax0 157 INTEGER(i4) :: il_jmin0 158 INTEGER(i4) :: il_jmax0 159 141 160 INTEGER(i4) , DIMENSION(ip_maxdim) :: il_rho 161 INTEGER(i4) , DIMENSION(2) :: il_index 142 162 INTEGER(i4) , DIMENSION(2,2,ip_npoint) :: il_offset 143 163 … … 167 187 ! namcfg 168 188 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 189 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 169 190 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 170 191 … … 177 198 178 199 !namnst 200 REAL(sp) :: rn_lonmin0 = -360. 201 REAL(sp) :: rn_lonmax0 = -360. 202 REAL(sp) :: rn_latmin0 = -360. 203 REAL(sp) :: rn_latmax0 = -360. 179 204 INTEGER(i4) :: in_imin0 = 0 180 205 INTEGER(i4) :: in_imax0 = 0 … … 195 220 NAMELIST /namcfg/ & ! config namelist 196 221 & cn_varcfg, & !< variable configuration file 222 & cn_dimcfg, & !< dimension configuration file 197 223 & cn_dumcfg !< dummy configuration file 198 224 … … 207 233 208 234 NAMELIST /namnst/ & ! nesting namelist 235 & rn_lonmin0, & !< lower left coarse grid longitude 236 & rn_lonmax0, & !< upper right coarse grid longitude 237 & rn_latmin0, & !< lower left coarse grid latitude 238 & rn_latmax0, & !< upper right coarse grid latitude 209 239 & in_imin0, & !< i-direction lower left point indice 210 240 & in_imax0, & !< i-direction upper right point indice … … 255 285 CALL var_def_extra(TRIM(cn_varcfg)) 256 286 287 ! get dimension allowed 288 CALL dim_def_extra(TRIM(cn_dimcfg)) 289 257 290 ! get dummy variable 258 291 CALL var_get_dummy(TRIM(cn_dumcfg)) … … 301 334 302 335 ! check nesting parameters 303 IF( in_imin0 < 0 .OR. in_imax0 < 0 .OR. in_jmin0 < 0 .OR. in_jmax0 < 0)THEN 336 il_index(:)=0 337 IF( rn_lonmin0 >= -180. .AND. rn_lonmin0 <= 360 .AND. & 338 & rn_latmin0 >= -90. .AND. rn_latmin0 <= 90. )THEN 339 340 il_index(:)=grid_get_closest(tl_coord0, & 341 & REAL(rn_lonmin0,dp), REAL(rn_latmin0,dp), & 342 & cd_pos='ll') 343 il_imin0=il_index(1) 344 il_jmin0=il_index(2) 345 ELSE 346 il_imin0=in_imin0 347 il_jmin0=in_jmin0 348 ENDIF 349 350 il_index(:)=0 351 IF( rn_lonmax0 >= -180. .AND. rn_lonmax0 <= 360 .AND. & 352 & rn_latmax0 >= -90. .AND. rn_latmax0 <= 90. )THEN 353 354 il_index(:)=grid_get_closest(tl_coord0, & 355 & REAL(rn_lonmax0,dp), REAL(rn_latmax0,dp), & 356 & cd_pos='ur') 357 il_imax0=il_index(1) 358 il_jmax0=il_index(2) 359 ELSE 360 il_imax0=in_imax0 361 il_jmax0=in_jmax0 362 ENDIF 363 364 ! forced indices for east west cyclic domain 365 IF( rn_lonmin0 == rn_lonmax0 .AND. & 366 & rn_lonmin0 /= -360. )THEN 367 il_imin0=0 368 il_imax0=0 369 ENDIF 370 371 IF( il_imin0 < 0 .OR. il_imax0 < 0 .OR. il_jmin0 < 0 .OR. il_jmax0 < 0)THEN 304 372 CALL logger_fatal("CREATE COORD: invalid points indices."//& 305 373 & " check namelist "//TRIM(cl_namelist)) … … 318 386 319 387 ! check domain validity 320 CALL grid_check_dom(tl_coord0, i n_imin0, in_imax0, in_jmin0, in_jmax0 )388 CALL grid_check_dom(tl_coord0, il_imin0, il_imax0, il_jmin0, il_jmax0 ) 321 389 322 390 ! compute domain 323 391 tl_dom=dom_init( tl_coord0, & 324 & i n_imin0, in_imax0,&325 & i n_jmin0, in_jmax0 )392 & il_imin0, il_imax0,& 393 & il_jmin0, il_jmax0 ) 326 394 327 395 ! add extra band (if need be) to compute interpolation … … 425 493 IF( il_attid == 0 )THEN 426 494 il_ind=var_get_index(tl_fileout%t_var(:),'longitude') 495 IF( il_ind == 0 )THEN 496 il_ind=var_get_index(tl_fileout%t_var(:),'longitude_T') 497 ENDIF 427 498 il_ew=grid_get_ew_overlap(tl_fileout%t_var(il_ind)) 428 499 IF( il_ew >= 0 )THEN … … 447 518 448 519 CALL file_clean(tl_fileout) 520 CALL var_clean_extra() 449 521 450 522 ! close log file -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_restart.f90
r6392 r8862 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). … … 63 65 !> * _vertical grid namelist (namzgr)_:<br/> 64 66 !> - 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 : 67 !> - dn_ppsur : coefficient to compute vertical grid 68 !> - dn_ppa0 : coefficient to compute vertical grid 69 !> - dn_ppa1 : coefficient to compute vertical grid 70 !> - dn_ppa2 : double tanh function parameter 71 !> - dn_ppkth : coefficient to compute vertical grid 72 !> - dn_ppkth2 : double tanh function parameter 73 !> - dn_ppacr : coefficient to compute vertical grid 74 !> - dn_ppacr2 : double tanh function parameter 75 !> - dn_ppdzmin : minimum vertical spacing 76 !> - dn_pphmax : maximum depth 75 77 !> - in_nlevel : number of vertical level 76 78 !> 77 79 !> * _partial step namelist (namzps)_:<br/> 78 !> - dn_e3zps_min : 79 !> - dn_e3zps_rat : 80 !> - dn_e3zps_min : minimum thickness of partial step level (meters) 81 !> - dn_e3zps_rat : minimum thickness ratio of partial step level 80 82 !> 81 83 !> * _variable namelist (namvar)_:<br/> … … 158 160 !> @date September, 2015 159 161 !> - manage useless (dummy) variable, attributes, and dimension 162 !> @date October, 2016 163 !> - dimension to be used select from configuration file 160 164 !> 161 165 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 196 200 INTEGER(i4) :: il_status 197 201 INTEGER(i4) :: il_fileid 202 INTEGER(i4) :: il_attid 198 203 INTEGER(i4) :: il_nvar 199 INTEGER(i4) :: il_attid200 204 INTEGER(i4) :: il_imin1 201 205 INTEGER(i4) :: il_imax1 … … 249 253 250 254 ! namcfg 251 CHARACTER(LEN=lc) :: cn_varcfg = 'variable.cfg' 252 CHARACTER(LEN=lc) :: cn_dumcfg = 'dummy.cfg' 255 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 256 CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 257 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 253 258 254 259 ! namcrs … … 304 309 NAMELIST /namcfg/ & !< configuration namelist 305 310 & cn_varcfg, & !< variable configuration file 311 & cn_dimcfg, & !< dimension configuration file 306 312 & cn_dumcfg !< dummy configuration file 307 313 … … 309 315 & cn_coord0, & !< coordinate file 310 316 & in_perio0 !< periodicity index 311 317 312 318 NAMELIST /namfin/ & !< fine grid namelist 313 319 & cn_coord1, & !< coordinate file … … 336 342 & cn_varfile, & !< list of variable file 337 343 & cn_varinfo !< list of variable and interpolation method to be used. 338 344 339 345 NAMELIST /namnst/ & !< nesting namelist 340 346 & in_rhoi, & !< refinement factor in i-direction … … 387 393 CALL var_def_extra(TRIM(cn_varcfg)) 388 394 395 ! get dimension allowed 396 CALL dim_def_extra(TRIM(cn_dimcfg)) 397 389 398 ! get dummy variable 390 399 CALL var_get_dummy(TRIM(cn_dumcfg)) … … 402 411 ! match variable with file 403 412 tl_multi=multi_init(cn_varfile) 404 413 405 414 READ( il_fileid, NML = namnst ) 406 415 READ( il_fileid, NML = namout ) … … 592 601 !- check grid coincidence 593 602 IF( ll_sameGrid )THEN 603 il_rho(:)=1 594 604 CALL grid_check_coincidence( tl_mpp, tl_coord1, & 595 605 & il_imin1, il_imax1, & … … 896 906 CALL mpp_clean(tl_mppout) 897 907 CALL mpp_clean(tl_coord1) 908 CALL var_clean_extra() 898 909 899 910 ! close log file … … 1200 1211 & tl_depth%d_value(:,:,:,:) ) )THEN 1201 1212 1202 CALL logger_warn("CREATE BOUNDARY: depth value from "//&1213 CALL logger_warn("CREATE RESTART: depth value from "//& 1203 1214 & TRIM(td_mpp%c_name)//" not conform "//& 1204 1215 & " to those from former file(s).") -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/dimension.f90
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md
r7372 r8862 59 59 &namcfg 60 60 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 61 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 61 62 / 62 63 … … 83 84 / 84 85 ~~~~~~~~~~~ 86 87 @note you could define sub domain with coarse grid indices or with coordinates. 85 88 86 89 Let's get describe this namelist.<br/> … … 90 93 empty, as done here.<br/> This will create a log file named *create_coord.log* 91 94 92 The **namcfg** sub-namelist defines where found SIREN configuration file .<br/>93 Thisconfiguration file defines standard name, default interpolation method,95 The **namcfg** sub-namelist defines where found SIREN configuration files.<br/> 96 - The variable configuration file defines standard name, default interpolation method, 94 97 axis,... to be used for some known variables.<br/> 95 98 Obviously, you could add other variables to those already list, in this file. 96 97 @note You could find the generic version of *variable.cfg* in the directory *NEMOGCM/TOOLS/SIREN/cfg*. 99 - The dimension configuration file defines dimensions allowed. 100 101 @note You could find the generic version of those configuration files in the directory *NEMOGCM/TOOLS/SIREN/cfg*. 98 102 99 103 The **namcrs** sub-namelist set parameters of the wide 100 coordinates file, <br/>as path to find it, and NEMO periodicity of the wide grid.<br/>104 coordinates file, as path to find it, and NEMO periodicity of the wide grid.<br/> 101 105 102 106 @note the NEMO periodicity could be choose between 0 to 6: … … 130 134 131 135 The **namnst** sub-namelist defines the subdomain to be used as well as refinment factor.<br/> 132 @note Subdomain is defined by indices of the coarse/wide grid.<br/>133 136 134 137 <ul> 135 <li>you can select area quite every where (excepted too close from the North 136 pole), and use the refinment factor you want.</li> 137 138 ~~~~~~~~~~~ 139 &namvar 138 <li> you could define sub domain with coarse grid indices</li> 139 140 ~~~~~~~~~~~ 141 &namnst 140 142 in_imin0 = 1070 141 143 in_imax0 = 1072 142 144 in_jmin0 = 607 143 145 in_jmax0 = 609 146 / 147 ~~~~~~~~~~~ 148 149 <li>or with coordinates</li> 150 151 ~~~~~~~~~~~ 152 &namnst 153 rn_lonmin0 = -97.9 154 rn_lonmax0 = -62.3 155 rn_latmin0 = 7.7 156 rn_latmax0 = 30.8 157 / 158 ~~~~~~~~~~~ 159 160 <li>you can select area quite every where (excepted too close from the North 161 pole), and use the refinment factor you want.</li> 162 163 ~~~~~~~~~~~ 164 &namnst 165 in_imin0 = 1070 166 in_imax0 = 1072 167 in_jmin0 = 607 168 in_jmax0 = 609 144 169 145 170 in_rhoi = 2 … … 148 173 ~~~~~~~~~~~ 149 174 @image html grid_zoom_60.png 150 @image latex grid_zoom_40.png 175 <center>@image latex grid_zoom_40.png 176 </center> 151 177 <!-- @note ghost cells all around the grid are not shown here. --> 152 178 179 180 153 181 <li>you can select area crossing the east-west overlap of the global ORCA grid.</li> 154 182 155 183 ~~~~~~~~~~~ 156 &nam var184 &namnst 157 185 in_imin0 = 1402 158 186 in_imax0 = 62 … … 165 193 ~~~~~~~~~~~ 166 194 @image html grid_glob_over_30.png 167 @image latex grid_glob_over_20.png 195 <center>@image latex grid_glob_over_20.png 196 </center> 168 197 <!-- @note in blue, the east-west overlap band of ORCA grid. --> 169 198 … … 171 200 172 201 ~~~~~~~~~~~ 173 &nam var202 &namnst 174 203 in_imin0 = 0 175 204 in_imax0 = 0 … … 182 211 ~~~~~~~~~~~ 183 212 @image html grid_glob_band_30.png 184 @image latex grid_glob_band_20.png 213 <center>@image latex grid_glob_band_20.png 214 </center> 185 215 186 216 </ul> … … 215 245 &namcfg 216 246 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 247 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 217 248 / 218 249 … … 249 280 coordinates file.<br/> 250 281 @note in all SIREN namelist: <br/> 251 0referred to the coarse/wide grid.<br/>252 1referred to the fine grid.282 **0** referred to the coarse/wide grid.<br/> 283 **1** referred to the fine grid. 253 284 254 285 In the same way, the **namfin** sub-namelist set parameters of the fine 255 286 coordinates file.<br/> 256 287 @note in this namelist example, there is no need to set the variable *in_perio1* to define the NEMO 257 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/>258 So if you created the fine coordinates with SIREN, you do not have to288 periodicity of the fine grid. Indeed, if this variable is not inform, SIREN tries to read it 289 in the global attributes of the file. So if you created the fine coordinates with SIREN, you do not have to 259 290 fill it. In other case, you should add it to the namelist. 260 291 … … 296 327 # Merge bathymetry file # {#merge} 297 328 298 The Bathymetry you build differsfrom the wider one.<br/>329 The Bathymetry you build, may differ from the wider one.<br/> 299 330 To avoid issue with boundaries forcing fields, you should merge fine and coarse Bathymetry on boundaries.<br/> 300 331 SIREN allows you to do this.<br/> … … 312 343 &namcfg 313 344 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 345 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 314 346 / 315 347 … … 348 380 349 381 The **nambdy** sub-namelist defines the subdomain boundaries.<br/> 350 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/> 351 So you could let this namelist empty. 352 382 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. 353 383 @sa For more information about boundaries, see @ref boundary 354 384 … … 365 395 time step). Or you could start from "partial" information about ocean state (Temperature and Salinity for example). 366 396 367 S irenallows you to create both of those initial state.<br/>397 SIREN allows you to create both of those initial state.<br/> 368 398 To create the initial state, you have to run:<br/> 369 399 ~~~~~~~~~~~~~~~~~~ … … 372 402 373 403 Here after is an example of namelist for *create_restart.exe*.<br/> 374 In this example, you create an initial state split on 81 "processors", and named restar _out.nc.<br/>404 In this example, you create an initial state split on 81 "processors", and named restart_out.nc.<br/> 375 405 The initial state is composed of temperature and salinity refined from an extraction of GLORYS fields. 376 406 ~~~~~~~~~~~~~~~~~~ … … 380 410 &namcfg 381 411 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 412 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 382 413 / 383 414 … … 479 510 &namcfg 480 511 cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 512 cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 481 513 / 482 514 -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/5_changeLog.md
r7372 r8862 3 3 @tableofcontents 4 4 5 # Release 2016-11-285 # Release $Date:: 2016-11-16 #$ ($Revision: 7235 $) 6 6 7 ## New Features 8 - merge_bathy.f90: allow to choose the number of boundary point with coarse grid value. 9 - dimension.f90: dimension allowed read in configuration file. 10 - variable.f90: allow to add scalar value. 7 11 ## Changes 8 ## New Features 12 - create_coord.f90: allow to define sub domain with coarse grid indices or coordinates. 13 - grid.f90:grid__get_closest_str: add function to get closest grid point using coarse grid coordinates strucutre. 14 - iom_cdf.f90:iom_cdf__get_info: define cdf4 as cdf. 15 - variable.f90: add subroutine to clean global array of extra information, and define logical for variable to be used. 16 - create_coord.f90: dimension to be used select from configuration file. 17 - create_bathy.f90: dimension to be used select from configuration file. 18 - merge_bathy.f90: dimension to be used select from configuration file. 19 - create_boundary.f90: dimension to be used select from configuration file. 20 - create_restart.f90: dimension to be used select from configuration file. 9 21 ## Bug fixes 10 - boundary.f90: take into account that boundaries are compute on T point, but expressed on U,V point 11 - iom_cdf.f90: define type cdf4 as cdf 22 - boundary.f90:boundary_check: take into account that boundaries are compute on T point, but expressed on U,V point. 23 - grid.f90:grid__get_closest_str: use max of zero and east-west overlap instead of east-west overlap. 24 - mpp.f90: compare index to td_lay number of proc instead of td_mpp (bug fix) . 25 - iom_cdf.f90 : check if attribute cl_value is not bug (in read file) 12 26 13 release (2016-07-01) 27 # Release 2016-07-01 14 28 15 29 ## Changes … … 18 32 - correct check of boundary indices 19 33 20 # Release 21 Initial release (2016-04-11) 34 # Initial Release 2016-04-11 22 35 23 36 <HR> -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/6_perio.md
r6468 r8862 6 6 <dd>ghost cells (solid walls) are imposed at all model boundaries.</dd> 7 7 @image html perio0_20.png 8 @latexonly 9 \begin{center} 10 \includegraphics{perio0_20.png} 11 \end{center} 12 @endlatexonly 8 <center>@image latex perio0_20.png 9 </center> 13 10 <dt>cyclic east-west boundary (in_perio=1)</dt> 14 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> 15 12 @image html perio1_20.png 16 @latexonly 17 \begin{center} 18 \includegraphics{perio1_20.png} 19 \end{center} 20 @endlatexonly 13 <center>@image latex perio1_20.png 14 </center> 21 15 <dt>symmetric boundary condition across the equator. (in_perio=2)</dt> 22 16 <dd>last row, and first and last columns are closed. </dd> 23 17 @image html perio2_20.png 24 @latexonly 25 \begin{center} 26 \includegraphics{perio2_20.png} 27 \end{center} 28 @endlatexonly 18 <center>@image latex perio2_20.png 19 </center> 29 20 <dt>North fold boundary with a T -point pivot (in_perio=3)</dt> 30 21 <dd>first row, and first and last columns are closed. </dd> 31 22 @image html perio3_20.png 32 @latexonly 33 \begin{center} 34 \includegraphics{perio3_20.png} 35 \end{center} 36 @endlatexonly 23 <center>@image latex perio3_20.png 24 </center> 37 25 <dt>North fold boundary with a T -point pivot and cyclic east-west boundary (in_perio=4)</dt> 38 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> 39 27 @image html perio4_20.png 40 @latexonly 41 \begin{center} 42 \includegraphics{perio4_20.png} 43 \end{center} 44 @endlatexonly 28 <center>@image latex perio4_20.png 29 </center> 45 30 <dt>North fold boundary with a F -point pivot (in_perio=5)</dt> 46 31 <dd>first row, and first and last columns are closed. </dd> 47 32 @image html perio5_20.png 48 @latexonly 49 \begin{center} 50 \includegraphics{perio5_20.png} 51 \end{center} 52 @endlatexonly 33 <center>@image latex perio5_20.png 34 </center> 53 35 <dt>North fold boundary with a F -point pivot and cyclic east-west boundary (in_perio=6)</dt> 54 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> 55 37 @image html perio6_20.png 56 @image html perio5_20.png 57 @latexonly 58 \begin{center} 59 \includegraphics{perio6_20.png} 60 \end{center} 61 @endlatexonly 38 <center>@image latex perio6_20.png 39 </center> 62 40 </dl> 63 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/global.f90
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/grid.f90
r7372 r8862 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') … … 5112 5250 dl_lon1 = dd_lon1(il_imin1, il_jmax1) 5113 5251 dl_lat1 = dd_lat1(il_imin1, il_jmax1) 5114 5115 5252 5116 5253 IF( (ABS(dl_lon1-dl_lon0)>dp_delta) .AND. (dl_lon1 < dl_lon0) .OR. & -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom.f90
r7372 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90
r7372 r8862 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) 344 !td_file%c_type='cdf4' 342 345 td_file%c_type='cdf' 343 !td_file%c_type='cdf4'344 346 END SELECT 345 347 CALL logger_debug("IOM CDF GET INFO: type "//TRIM(td_file%c_type)) … … 353 355 !> reorder dimension to ('x', 'y', 'z', 't'). 354 356 !> The dimension structure inside file structure is then completed. 355 ! 356 !> @author J.Paul 357 !> @date November, 2013 - Initial Version 358 ! 357 !> 358 !> @author J.Paul 359 !> @date November, 2013 - Initial Version 360 !> @date October, 2016 361 !> - check unknown dimension 362 !> 359 363 !> @param[inout] td_file file structure 360 364 !------------------------------------------------------------------- … … 377 381 378 382 IF( td_file%i_ndim > 0 )THEN 383 379 384 ii=1 380 385 DO ji = 1, td_file%i_ndim 381 386 ! read dimension information 382 387 tl_dim=iom_cdf_read_dim( td_file, ji) 383 IF( .NOT. dim_is_dummy(tl_dim) )THEN 388 ! sname == 'u' if dimension is unknown (not to be used) 389 IF( TRIM(tl_dim%c_sname) /= 'u' )THEN 384 390 IF( ii > ip_maxdim )THEN 385 391 CALL logger_fatal("IOM CDF OPEN: too much dimension "//& 386 & "to be read. you should remove dummy dimension using"//&392 & "to be read. you could choose dimension to be used. see "//& 387 393 & " configuration file") 388 394 ENDIF … … 397 403 & " IOM CDF GET FILE DIM: there is no unlimited dimension in file "//& 398 404 & TRIM(td_file%c_name)) 399 ELSE400 td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE.405 !ELSE 406 ! td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE. 401 407 ENDIF 402 408 … … 468 474 !> The variable structure inside file structure is then completed. 469 475 !> @note variable value are not read ! 470 ! 476 !> 471 477 !> @author J.Paul 472 478 !> @date November, 2013 - Initial Version … … 475 481 !> @date January, 2016 476 482 !> - increment n3d for 4D variable 477 ! 483 !> @date October, 2016 484 !> - check variable to be used (variable's dimension allowed and variable 485 !> not "dummy") 486 !> 478 487 !> @param[inout] td_file file structure 479 488 !------------------------------------------------------------------- … … 503 512 il_nvar=td_file%i_nvar 504 513 ALLOCATE(tl_var(il_nvar)) 505 ii=0506 514 DO ji = 1, il_nvar 507 515 ! read variable information 508 516 tl_var(ji)=iom_cdf__read_var_meta( td_file, ji) 509 IF( .NOT. var_is_dummy(tl_var(ji)) )THEN510 ii=ii+1511 ENDIF512 517 ENDDO 513 518 514 519 ! update number of variable used 515 td_file%i_nvar= ii520 td_file%i_nvar=COUNT(tl_var(:)%l_use) 516 521 517 522 ALLOCATE(td_file%t_var(td_file%i_nvar)) … … 519 524 ii=0 520 525 DO ji = 1, il_nvar 521 IF( .NOT. var_is_dummy(tl_var(ji)))THEN526 IF( tl_var(ji)%l_use )THEN 522 527 ii=ii+1 523 528 td_file%t_var(ii)=var_copy(tl_var(ji)) … … 554 559 td_file%i_timeid=ji 555 560 ELSE 561 IF( td_file%i_timeid /= ji )THEN 562 CALL logger_warn("IOM CDF GET FILE VAR: find more "//& 563 & "than one time variable in file "//& 564 & TRIM(td_file%c_name)//". see "//& 565 & "dummy.cfg configuration file to"//& 566 & " not used dummy variables.") 567 ENDIF 556 568 il_attid=0 557 569 IF( ASSOCIATED(td_file%t_var(ii)%t_att) )THEN … … 560 572 IF( il_attid /= 0 )THEN 561 573 td_file%i_timeid=ji 562 !ELSE563 ! CALL logger_error("IOM CDF GET FILE VAR: find more "//&564 ! & "than one time variable in file "//&565 ! & TRIM(td_file%c_name) )566 574 ENDIF 567 575 ENDIF … … 654 662 & " IOM CDF READ DIM: no id associated to file "//TRIM(td_file%c_name)) 655 663 656 ELSE 664 ELSE 657 665 658 666 CALL logger_trace( & … … 725 733 !> @author J.Paul 726 734 !> @date November, 2013 - Initial Version 735 !> @date November 2017 736 !> - check if cl_value is not bug 727 737 ! 728 738 !> @param[in] td_file file structure … … 795 805 796 806 CASE(NF90_CHAR) 807 CALL logger_debug( " IOM CDF READ ATT: get NF90_CHAR ") 797 808 798 809 ! check string lengths … … 811 822 CALL iom_cdf__check(il_status,"IOM CDF READ ATT: ") 812 823 824 ! check cl_value 825 IF( LLT(cl_value,'') ) cl_value = '' 813 826 iom_cdf__read_att_name=att_init(cl_name, cl_value) 814 827 … … 816 829 817 830 CASE(NF90_BYTE) 831 CALL logger_debug( " IOM CDF READ ATT: get NF90_BYTE ") 818 832 819 833 ALLOCATE( bl_value( il_len), & … … 839 853 840 854 CASE(NF90_SHORT) 855 CALL logger_debug( " IOM CDF READ ATT: get NF90_SHORT ") 841 856 842 857 ALLOCATE( sl_value( il_len), & … … 863 878 864 879 CASE(NF90_INT) 880 CALL logger_debug( " IOM CDF READ ATT: get NF90_INT ") 865 881 866 882 ALLOCATE( il_value( il_len), & … … 886 902 887 903 CASE(NF90_FLOAT) 904 CALL logger_debug( " IOM CDF READ ATT: get NF90_FLOAT ") 888 905 889 906 ALLOCATE( fl_value( il_len), & … … 910 927 911 928 CASE(NF90_DOUBLE) 929 CALL logger_debug( " IOM CDF READ ATT: get NF90_DOUBLE ") 912 930 913 931 ALLOCATE( dl_value( il_len), & … … 1415 1433 ENDDO 1416 1434 1435 !! check if variable is dummy 1436 IF( var_is_dummy(iom_cdf__read_var_meta) )THEN 1437 iom_cdf__read_var_meta%l_use=.FALSE. 1438 ENDIF 1439 1440 !! check if all dimensions are allowed 1441 DO ji=1,il_ndim 1442 IF( ALL(td_file%t_dim(:)%i_id /= il_dimid(ji)) )THEN 1443 iom_cdf__read_var_meta%l_use=.FALSE. 1444 ENDIF 1445 ENDDO 1446 1417 1447 ! clean 1418 1448 CALL dim_clean(tl_dim(:)) … … 1486 1516 ELSE IF( id_ndim > 0 )THEN 1487 1517 1488 1489 1518 ii=1 1490 1519 DO ji = 1, id_ndim 1491 1520 1492 ! !! check no dummy dimension to be used1521 ! check if dimension to be used, is allowed 1493 1522 IF( ANY(td_file%t_dim(:)%i_id == id_dimid(ji)) )THEN 1494 1523 IF( ii > ip_maxdim )THEN … … 1506 1535 tl_dim(ii) = dim_init( td_file%t_dim(il_xyzt2(ii))%c_name, & 1507 1536 & td_file%t_dim(il_xyzt2(ii))%i_len ) 1508 1537 1509 1538 ii=ii+1 1510 1539 ELSE … … 2082 2111 & 'gcost','gcosu','gcosv','gcosf', & 2083 2112 & 'gsint','gsinu','gsinv','gsinf', & 2084 & 'mbathy','misf','isf_draft', &2113 & 'mbathy','misf','isf_draft','isfdraft', & 2085 2114 & 'hbatt','hbatu','hbatv','hbatf', & 2086 2115 & 'gsigt','gsigu','gsigv','gsigf', & … … 2191 2220 CALL iom_cdf__check(il_status,"IOM CDF WRITE VAR DEF: ") 2192 2221 ENDIF 2222 CALL logger_debug("IOM CDF WRITE VAR DEF: type = "//TRIM(fct_str(tl_var%i_type))) 2193 2223 2194 2224 ! remove unuseful attribute -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_mpp.f90
r6392 r8862 385 385 CHARACTER(LEN=*), INTENT(IN) :: cd_name 386 386 INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_start 387 INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_count 387 INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_count 388 388 389 389 ! local variable -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/merge_bathy.f90
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/mpp.f90
r6392 r8862 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 … … 586 586 WRITE(*,'(/a)') " Variable(s) used : " 587 587 DO ji=1,td_mpp%t_proc(1)%i_nvar 588 WRITE(*,'(3x,a)') TRIM(td_mpp%t_proc(1)%t_var(ji)%c_name) 588 WRITE(*,'(3x,a)') TRIM(td_mpp%t_proc(1)%t_var(ji)%c_name) 589 589 ENDDO 590 590 ENDIF … … 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/phycst.f90
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/variable.f90
r6392 r8862 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/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/vgrid.f90
r6392 r8862 751 751 ENDIF 752 752 753 ! get ghost ecell753 ! get ghost cell 754 754 il_xghost(:,:)=grid_get_ghost(tl_bathy) 755 755 -
branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/templates/merge_bathy.nam
r6392 r8862 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.