- Timestamp:
- 2016-11-18T09:34:22+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/TOOLS/SIREN/src/create_coord.f90
r5602 r7261 9 9 !> @file 10 10 !> @brief 11 !> This program create fine grid coordinate file.11 !> This program creates fine grid coordinate file. 12 12 !> 13 13 !> @details … … 24 24 !> @endcode 25 25 !> 26 !> create_coord.nam comprise 6 namelists:<br/> 26 !> @note 27 !> you could find a template of the namelist in templates directory. 28 !> 29 !> create_coord.nam contains 6 namelists:<br/> 27 30 !> - logger namelist (namlog) 28 31 !> - config namelist (namcfg) … … 32 35 !> - output namelist (namout) 33 36 !> 34 !> @note35 !> All namelists have to be in file create_coord.nam,36 !> however variables of those namelists are all optional.37 !>38 37 !> * _logger namelist (namlog)_:<br/> 39 38 !> - cn_logfile : log filename 40 39 !> - cn_verbosity : verbosity ('trace','debug','info', 41 !> 'warning','error','fatal' )40 !> 'warning','error','fatal','none') 42 41 !> - in_maxerror : maximum number of error allowed 43 42 !> … … 45 44 !> - cn_varcfg : variable configuration file 46 45 !> (see ./SIREN/cfg/variable.cfg) 46 !> - cn_dumcfg : useless (dummy) configuration file, for useless 47 !> dimension or variable (see ./SIREN/cfg/dummy.cfg). 47 48 !> 48 49 !> * _coarse grid namelist (namcrs)_:<br/> … … 54 55 !> - cn_varinfo : list of variable and extra information about request(s) 55 56 !> to be used.<br/> 56 !> each elements of *cn_varinfo* is a string character.<br/> 57 !> each elements of *cn_varinfo* is a string character 58 !> (separated by ',').<br/> 57 59 !> it is composed of the variable name follow by ':', 58 60 !> then request(s) to be used on this variable.<br/> 59 61 !> request could be: 60 !> - interpolation method 61 !> - extrapolation method 62 !> - filter method 62 !> - int = interpolation method 63 !> - ext = extrapolation method 63 64 !> 64 65 !> requests must be separated by ';' .<br/> … … 68 69 !> @ref extrap and @ref filter modules.<br/> 69 70 !> 70 !> Example: ' votemper: linear; hann(2,3);dist_weight',71 !> ' vosaline: cubic'<br/>71 !> Example: 'glamt: int=linear; ext=dist_weight', 72 !> 'e1t: int=cubic/rhoi'<br/> 72 73 !> @note 73 74 !> If you do not specify a method which is required, … … 90 91 !> 91 92 !> * _output namelist (namout)_: 92 !> - cn_fileout : output coordinate file 93 !> - cn_fileout : output coordinate file name 93 94 !> 94 95 !> @author J.Paul … … 99 100 !> - compute offset considering grid point 100 101 !> - add global attributes in output file 102 !> @date September, 2015 103 !> - manage useless (dummy) variable, attributes, and dimension 101 104 !> 102 105 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 152 155 TYPE(TFILE) :: tl_fileout 153 156 154 ! check155 ! INTEGER(i4) :: il_imin0156 ! INTEGER(i4) :: il_imax0157 ! INTEGER(i4) :: il_jmin0158 ! INTEGER(i4) :: il_jmax0159 ! INTEGER(i4) , DIMENSION(2,2) :: il_ind2160 ! TYPE(TMPP) :: tl_mppout161 162 157 ! loop indices 163 158 INTEGER(i4) :: ji … … 165 160 166 161 ! namelist variable 162 ! namlog 167 163 CHARACTER(LEN=lc) :: cn_logfile = 'create_coord.log' 168 164 CHARACTER(LEN=lc) :: cn_verbosity = 'warning' 169 165 INTEGER(i4) :: in_maxerror = 5 170 166 167 ! namcfg 168 CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 169 CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 170 171 ! namcrs 171 172 CHARACTER(LEN=lc) :: cn_coord0 = '' 172 173 INTEGER(i4) :: in_perio0 = -1 173 174 174 CHARACTER(LEN=lc) :: cn_varcfg = '../cfg/variable.cfg' 175 175 ! namvar 176 176 CHARACTER(LEN=lc), DIMENSION(ip_maxvar) :: cn_varinfo = '' 177 177 178 !namnst 178 179 INTEGER(i4) :: in_imin0 = 0 179 180 INTEGER(i4) :: in_imax0 = 0 … … 183 184 INTEGER(i4) :: in_rhoj = 1 184 185 186 !namout 185 187 CHARACTER(LEN=lc) :: cn_fileout= 'coord_fine.nc' 186 188 !------------------------------------------------------------------- … … 192 194 193 195 NAMELIST /namcfg/ & ! config namelist 194 & cn_varcfg !< variable configuration file 196 & cn_varcfg, & !< variable configuration file 197 & cn_dumcfg !< dummy configuration file 195 198 196 199 NAMELIST /namcrs/ & ! coarse grid namelist … … 252 255 CALL var_def_extra(TRIM(cn_varcfg)) 253 256 257 ! get dummy variable 258 CALL var_get_dummy(TRIM(cn_dumcfg)) 259 ! get dummy dimension 260 CALL dim_get_dummy(TRIM(cn_dumcfg)) 261 ! get dummy attribute 262 CALL att_get_dummy(TRIM(cn_dumcfg)) 263 254 264 READ( il_fileid, NML = namcrs ) 255 265 READ( il_fileid, NML = namvar ) … … 305 315 306 316 il_offset(:,:,:)=create_coord_get_offset(il_rho(:)) 307 308 317 ENDIF 309 318 … … 348 357 CALL dom_del_extra( tl_var(ji), tl_dom, il_rho(:), .true. ) 349 358 350 ! do not add ghost cell.351 ! ghost cell already replace by value for coordinates352 ! CALL grid_add_ghost(tl_var(ji),tl_dom%i_ghost(:,:))353 354 359 ! filter 355 360 CALL filter_fill_value(tl_var(ji)) 356 361 357 362 ENDDO 363 364 ! clean 365 CALL dom_clean_extra( tl_dom ) 358 366 359 367 ! close mpp files … … 375 383 376 384 ! add variables 377 DO ji= 1,il_nvar385 DO ji=il_nvar,1,-1 378 386 CALL file_add_var(tl_fileout, tl_var(ji)) 387 CALL var_clean(tl_var(ji)) 379 388 ENDDO 380 381 ! recompute some attribute382 389 383 390 ! add some attribute … … 392 399 CALL file_add_att(tl_fileout, tl_att) 393 400 394 tl_att=att_init("src_i_indices",(/ in_imin0,in_imax0/))401 tl_att=att_init("src_i_indices",(/tl_dom%i_imin,tl_dom%i_imax/)) 395 402 CALL file_add_att(tl_fileout, tl_att) 396 tl_att=att_init("src_j_indices",(/ in_jmin0,in_jmax0/))403 tl_att=att_init("src_j_indices",(/tl_dom%i_jmin,tl_dom%i_jmax/)) 397 404 CALL file_add_att(tl_fileout, tl_att) 398 405 IF( .NOT. ALL(il_rho(:)==1) )THEN … … 440 447 441 448 CALL file_clean(tl_fileout) 442 443 ! ! check domain444 ! tl_coord0=mpp_init( file_init(TRIM(cn_coord0)), id_perio=in_perio0)445 ! tl_mppout=mpp_init( file_init(TRIM(cn_fileout)) )446 ! CALL grid_get_info(tl_coord0)447 ! CALL iom_mpp_open(tl_mppout)448 !449 ! il_ind2(:,:)=grid_get_coarse_index( tl_coord0, tl_mppout, &450 ! & id_rho=il_rho(:) )451 !452 ! il_imin0=il_ind2(1,1) ; il_imax0=il_ind2(1,2)453 ! il_jmin0=il_ind2(2,1) ; il_jmax0=il_ind2(2,2)454 !455 ! IF( il_imin0 /= in_imin0 .OR. &456 ! & il_imax0 /= in_imax0 .OR. &457 ! & il_jmin0 /= in_jmin0 .OR. &458 ! & il_jmax0 /= in_jmax0 )THEN459 ! CALL logger_debug("CREATE COORD: output indices ("//&460 ! & TRIM(fct_str(il_imin0))//","//&461 ! & TRIM(fct_str(il_imax0))//") ("//&462 ! & TRIM(fct_str(il_jmin0))//","//&463 ! & TRIM(fct_str(il_jmax0))//")" )464 ! CALL logger_debug("CREATE COORD: input indices ("//&465 ! & TRIM(fct_str(in_imin0))//","//&466 ! & TRIM(fct_str(in_imax0))//") ("//&467 ! & TRIM(fct_str(in_jmin0))//","//&468 ! & TRIM(fct_str(in_jmax0))//")" )469 ! CALL logger_fatal("CREATE COORD: output domain not confrom "//&470 ! & "with input indices")471 ! ENDIF472 !473 ! CALL iom_mpp_close(tl_coord0)474 ! CALL iom_mpp_close(tl_mppout)475 449 476 450 ! close log file … … 539 513 !> @param[in] id_iext number of points to be extrapolated in i-direction 540 514 !> @param[in] id_jext number of points to be extrapolated in j-direction 515 !> 516 !> @todo check if mask is really needed 541 517 !------------------------------------------------------------------- 542 518 SUBROUTINE create_coord_interp( td_var, & … … 626 602 627 603 ! extrapolate variable 628 CALL extrap_fill_value( td_var , id_iext=il_iext, id_jext=il_jext)604 CALL extrap_fill_value( td_var ) 629 605 630 606 ! interpolate variable
Note: See TracChangeset
for help on using the changeset viewer.