Changeset 13369 for utils/tools/SIREN/src/addline_deg.f90
- Timestamp:
- 2020-07-31T10:50:52+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/tools/SIREN/src/addline_deg.f90
r12080 r13369 3 3 !---------------------------------------------------------------------- 4 4 !> @file 5 !> @brief 5 !> @brief 6 6 !> This program add line to all variables of the input file. 7 7 !> … … 25 25 !> 26 26 !> here after, each sub-namelist parameters is detailed. 27 !> @note 27 !> @note 28 28 !> default values are specified between brackets 29 29 !> … … 44 44 !> - none 45 45 !> 46 !> - **in_maxerror** [@a 5]<br/> 46 !> - **in_maxerror** [@a 5]<br/> 47 47 !> maximum number of error allowed 48 48 !> … … 52 52 !> - **cn_varcfg** [@a ./cfg/variable.cfg]<br/> 53 53 !> path to the variable configuration file.<br/> 54 !> the variable configuration file defines standard name, 55 !> default interpolation method, axis,... 56 !> to be used for some known variables.<br/> 57 !> 58 !> - **cn_dimcfg** [@a ./cfg/dimension.cfg]<br/> 59 !> path to the dimension configuration file.<br/> 60 !> the dimension configuration file defines dimensions allowed.<br/> 61 !> 62 !> - **cn_dumcfg** [@a ./cfg/dummy.cfg]<br/> 54 !> the variable configuration file defines standard name, 55 !> default interpolation method, axis,... 56 !> to be used for some known variables.<br/> 57 !> 58 !> - **cn_dimcfg** [@a ./cfg/dimension.cfg]<br/> 59 !> path to the dimension configuration file.<br/> 60 !> the dimension configuration file defines dimensions allowed.<br/> 61 !> 62 !> - **cn_dumcfg** [@a ./cfg/dummy.cfg]<br/> 63 63 !> path to the useless (dummy) configuration file.<br/> 64 !> the dummy configuration file defines useless 64 !> the dummy configuration file defines useless 65 65 !> dimension or variable. these dimension(s) or variable(s) will not be 66 66 !> processed.<br/> 67 67 !> 68 !> @subsection subsrc namsrc 68 !> @subsection subsrc namsrc 69 69 !> the source/coarse grid sub-namelist parameters are : 70 70 !> 71 !> - **cn_coord0** [@a ]<br/> 71 !> - **cn_coord0** [@a ]<br/> 72 72 !> path to the coordinate file 73 73 !> 74 !> - **in_perio0** [@a ]<br/> 75 !> NEMO periodicity index<br/> 74 !> - **in_perio0** [@a ]<br/> 75 !> NEMO periodicity index<br/> 76 76 !> the NEMO periodicity could be choose between 0 to 6: 77 77 !> <dl> … … 95 95 !> </dl> 96 96 !> @sa For more information see @ref md_src_docsrc_6_perio 97 !> and Model Boundary Condition paragraph in the 97 !> and Model Boundary Condition paragraph in the 98 98 !> [NEMO documentation](https://forge.ipsl.jussieu.fr/nemo/chrome/site/doc/NEMO/manual/pdf/NEMO_manual.pdf) 99 99 !> 100 !> @subsection subvar namvar 100 !> @subsection subvar namvar 101 101 !> the variable sub-namelist parameters are : 102 102 !> 103 !> - **cn_varfile** [@a ]<br/> 104 !> list of variable, and associated file 103 !> - **cn_varfile** [@a ]<br/> 104 !> list of variable, and associated file 105 105 !> 106 106 !> *cn_varfile* is the path and filename of the file where find 107 107 !> variable. 108 !> @note 108 !> @note 109 109 !> *cn_varfile* could be a matrix of value, if you want to handwrite 110 110 !> variable value.<br/> 111 111 !> the variable array of value is split into equal subdomain.<br/> 112 !> each subdomain is filled with the corresponding value 113 !> of the matrix.<br/> 112 !> each subdomain is filled with the corresponding value 113 !> of the matrix.<br/> 114 114 !> separators used to defined matrix are: 115 115 !> - ',' for line … … 120 120 !> 1 & 4 & 5 \end{array} \right) @f$ 121 121 !> 122 !> Examples: 122 !> Examples: 123 123 !> - 'Bathymetry:gridT.nc' 124 124 !> 125 !> @note 125 !> @note 126 126 !> Optionnaly, NEMO periodicity could be added following the filename. 127 127 !> the periodicity must be separated by ';' … … 130 130 !> - 'Bathymetry:gridT.nc ; perio=4'<br/> 131 131 !> 132 !> - **cn_varinfo** [@a ]<br/> 132 !> - **cn_varinfo** [@a ]<br/> 133 133 !> list of variable and extra information about request(s) to be used<br/> 134 134 !> 135 135 !> each elements of *cn_varinfo* is a string character (separated by ',').<br/> 136 !> it is composed of the variable name follow by ':', 137 !> then request(s) to be used on this variable.<br/> 136 !> it is composed of the variable name follow by ':', 137 !> then request(s) to be used on this variable.<br/> 138 138 !> request could be: 139 139 !> - int = interpolation method … … 150 150 !> informations about available method could be find in @ref interp, 151 151 !> @ref extrap and @ref filter modules.<br/> 152 !> Example: 152 !> Example: 153 153 !> - 'Bathymetry: flt=2*hamming(2,3); min=0' 154 154 !> 155 !> @note 156 !> If you do not specify a method which is required, 155 !> @note 156 !> If you do not specify a method which is required, 157 157 !> default one is apply. 158 158 !> 159 !> @subsection subout namout 159 !> @subsection subout namout 160 160 !> the output sub-namelist parameter is : 161 161 !> … … 163 163 !> output filename 164 164 !> - @b ln_extrap [@a .FALSE.]<br/> 165 !> extrapolate extra line 165 !> extrapolate extra line 166 166 !> - @b ln_copy [@a .FALSE.]<br/> 167 167 !> copy extra line from above … … 220 220 221 221 TYPE(TATT) :: tl_att 222 222 223 223 TYPE(TVAR) :: tl_lon 224 224 TYPE(TVAR) :: tl_lat … … 228 228 TYPE(TVAR) :: tl_tmp 229 229 TYPE(TVAR) , DIMENSION(:), ALLOCATABLE :: tl_var 230 230 231 231 TYPE(TDIM) , DIMENSION(ip_maxdim) :: tl_dim 232 232 … … 241 241 ! namelist variable 242 242 ! namlog 243 CHARACTER(LEN=lc) :: cn_logfile = 'addline.log' 244 CHARACTER(LEN=lc) :: cn_verbosity = 'warning' 243 CHARACTER(LEN=lc) :: cn_logfile = 'addline.log' 244 CHARACTER(LEN=lc) :: cn_verbosity = 'warning' 245 245 INTEGER(i4) :: in_maxerror = 5 246 246 247 247 ! namcfg 248 CHARACTER(LEN=lc) :: cn_varcfg = 'variable.cfg' 249 CHARACTER(LEN=lc) :: cn_dimcfg = 'dimension.cfg' 250 CHARACTER(LEN=lc) :: cn_dumcfg = 'dummy.cfg' 248 CHARACTER(LEN=lc) :: cn_varcfg = 'variable.cfg' 249 CHARACTER(LEN=lc) :: cn_dimcfg = 'dimension.cfg' 250 CHARACTER(LEN=lc) :: cn_dumcfg = 'dummy.cfg' 251 251 252 252 ! namsrc 253 CHARACTER(LEN=lc) :: cn_coord0 = '' 253 CHARACTER(LEN=lc) :: cn_coord0 = '' 254 254 INTEGER(i4) :: in_perio0 = -1 255 255 … … 259 259 260 260 ! namout 261 CHARACTER(LEN=lc) :: cn_fileout = 'addline_deg.nc' 261 CHARACTER(LEN=lc) :: cn_fileout = 'addline_deg.nc' 262 262 LOGICAL :: ln_extrap = .FALSE. 263 263 LOGICAL :: ln_copy = .FALSE. … … 281 281 & cn_coord0, & !< coordinate file 282 282 & in_perio0 !< periodicity index 283 283 284 284 NAMELIST /namvar/ & !< variable namelist 285 285 & cn_varinfo, & !< list of variable and interpolation method to be used. (ex: 'votemper:linear','vosaline:cubic' ) … … 305 305 CALL GET_COMMAND_ARGUMENT(1,cl_namelist) !f03 intrinsec 306 306 ENDIF 307 307 308 308 ! read namelist 309 309 INQUIRE(FILE=TRIM(cl_namelist), EXIST=ll_exist) 310 310 IF( ll_exist )THEN 311 311 312 312 il_fileid=fct_getunit() 313 313 … … 349 349 ! match variable with file 350 350 tl_multi=multi_init(cn_varfile) 351 351 352 352 READ( il_fileid, NML = namout ) 353 353 … … 373 373 ELSE 374 374 CALL logger_fatal("ADD LINE: no coarse grid coordinate found. "//& 375 & "check namelist") 375 & "check namelist") 376 376 ENDIF 377 377 … … 393 393 jk=0 394 394 DO ji=1,tl_multi%i_nmpp 395 395 396 396 IF( .NOT. ASSOCIATED(tl_multi%t_mpp(ji)%t_proc(1)%t_var) )THEN 397 397 … … 445 445 CALL iom_mpp_close(tl_mpp) 446 446 447 !- add line to input file variable 447 !- add line to input file variable 448 448 DO jj=1,tl_multi%t_mpp(ji)%t_proc(1)%i_nvar 449 449 jk=jk+1 450 450 tl_tmp=var_copy(tl_multi%t_mpp(ji)%t_proc(1)%t_var(jj)) 451 451 WRITE(*,'(2x,a)') "work on variable "//TRIM(tl_tmp%c_name) 452 452 453 453 tl_var(jk)=add_line( tl_tmp, tl_mpp, & 454 454 & tl_coord0 ) … … 500 500 DO ji=1,ip_maxdim 501 501 502 IF( tl_dim(ji)%l_use )THEN502 IF( tl_dim(ji)%l_use .AND. .NOT. tl_mppout%t_dim(ji)%l_use )THEN 503 503 CALL mpp_move_dim(tl_mppout, tl_dim(ji)) 504 504 SELECT CASE(TRIM(tl_dim(ji)%c_sname)) … … 507 507 CALL file_add_dim(tl_mppout%t_proc(jj), tl_dim(ji)) 508 508 ENDDO 509 END SELECT 509 END SELECT 510 510 ENDIF 511 511 … … 589 589 CALL mpp_add_att(tl_mppout,tl_att) 590 590 ENDIF 591 591 592 592 ! print 593 593 CALL mpp_print(tl_mppout) … … 620 620 !> @brief 621 621 !> This function add line to variable and return variable structure 622 !> 622 !> 623 623 !> @author J.Paul 624 624 !> @date October, 2015 - Initial Version 625 625 !> 626 !> @param[in] td_var variable structure 626 !> @param[in] td_var variable structure 627 627 !> @param[in] td_mpp mpp file structure 628 628 !> @param[in] td_coord coordinate file structure 629 629 !> @return variable structure 630 630 !------------------------------------------------------------------- 631 631 632 632 IMPLICIT NONE 633 633 634 634 ! Argument 635 TYPE(TVAR), INTENT(IN) :: td_var 635 TYPE(TVAR), INTENT(IN) :: td_var 636 636 TYPE(TMPP), INTENT(IN) :: td_mpp 637 637 TYPE(TMPP), INTENT(IN) :: td_coord … … 680 680 ! add attribute to variable 681 681 tl_att=att_init('src_file',TRIM(fct_basename(tl_mpp%c_name))) 682 CALL var_move_att(tf_var, tl_att) 682 CALL var_move_att(tf_var, tl_att) 683 683 684 684 tl_att=att_init('add_i_line',(/il_ghost(jp_I,1), il_ghost(jp_I,2)/)) … … 695 695 END FUNCTION add_line 696 696 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 697 END PROGRAM 697 END PROGRAM
Note: See TracChangeset
for help on using the changeset viewer.