Changeset 8a65cb0 in flexpart.git for src/FLEXPART.f90
- Timestamp:
- Mar 2, 2015, 3:11:55 PM (9 years ago)
- Branches:
- master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
- Children:
- 1d207bb
- Parents:
- 60403cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FLEXPART.f90
rb7ae015 r8a65cb0 44 44 use com_mod 45 45 use conv_mod 46 use netcdf_output_mod, only: writeheader_netcdf 47 use random_mod, only: gasdev1 46 48 47 49 implicit none … … 50 52 integer :: idummy = -320 51 53 character(len=256) :: inline_options !pathfile, flexversion, arg2 52 integer :: index_v 54 55 56 ! Initialize arrays in com_mod 57 !***************************** 58 call com_mod_allocate(maxpart) 59 60 53 61 54 62 ! Generate a large number of random numbers … … 61 69 62 70 ! FLEXPART version string 63 ! flexversion='Version 9.2 beta (2014-07-01)' 64 !flexversion='Version 9.2.0.1 (2015-01-27)' 65 flexversion='Version 9.2.0.2 (2015-03-01)' 66 ! default inlide options 67 inline_options='none' 68 !verbosity flags defined in com_mod.f90 69 71 flexversion='Version 10.0pre (2015-03-01)' 72 verbosity=0 73 70 74 ! Read the pathnames where input/output files are stored 71 75 !******************************************************* 72 76 77 inline_options='none' 73 78 select case (iargc()) 74 case (2) !2 parameters: pathfile and inline options79 case (2) 75 80 call getarg(1,arg1) 76 81 pathfile=arg1 77 82 call getarg(2,arg2) 78 83 inline_options=arg2 79 case (1) !1 parameter pathfiel or inline options84 case (1) 80 85 call getarg(1,arg1) 81 86 pathfile=arg1 … … 84 89 inline_options=arg1 85 90 endif 86 case (0) !default behavior91 case (0) 87 92 write(pathfile,'(a11)') './pathnames' 88 93 end select … … 92 97 print*,'Welcome to FLEXPART ', trim(flexversion) 93 98 print*,'FLEXPART is free software released under the GNU General Public License.' 94 95 ! inline options allow to fine tune the verbosity during run time 96 ! e.g.: show compilation parameters or input variables, time execution 99 97 100 if (inline_options(1:1).eq.'-') then 98 ! if (index(inline_options,'v').gt.0) then 99 ! print*, 'verbose mode' 100 ! verbosity=1 101 ! index_v=index(inline_options,'v') 102 ! if (inline_options(index_v+1:index_v+1).eq.'2') then 103 ! verbosity=2 104 ! endif 105 ! endif 106 107 !if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then 108 if (index(inline_options,'v').gt.0) then 109 index_v=index(inline_options,'v') 110 print*, 'Verbose mode: display additional information during run' 101 if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then 102 print*, 'Verbose mode 1: display detailed information during run' 111 103 verbosity=1 112 if (inline_options(index_v+1:index_v+1).eq.'2') then 104 endif 105 if (trim(inline_options).eq.'-v2') then 106 print*, 'Verbose mode 2: display more detailed information during run' 113 107 verbosity=2 114 endif 115 print*, 'verbosity level=', verbosity !inline_options(index_v+1:index_v+1) 116 endif 117 !iif (trim(inline_options).eq.'-v2') then 118 ! print*, 'Verbose mode 2: display more detailed information during run' 119 ! verbosity=2 120 !endif 121 122 if (index(inline_options,'i').gt.0) then 123 index_v=index(inline_options,'i') 124 print*, 'Info mode: provide compile and run specific information, then stop' 108 endif 109 if (trim(inline_options).eq.'-i') then 110 print*, 'Info mode: provide detailed run specific information and stop' 125 111 verbosity=1 126 112 info_flag=1 127 if (inline_options(index_v+1:index_v+1).eq.'2') then 128 info_flag=2 129 endif 130 endif 131 if (index(inline_options,'t').gt.0) then 132 time_flag=1 133 print*, 'timing execution activated' 134 !stop 135 endif 136 if (index(inline_options,'d').gt.0) then 137 debug_flag=1 138 print*, 'debug messages activated' 139 print*, 'debug_flag=', debug_flag 140 !these messages give additional info on top on verbose mode 141 endif 113 endif 114 if (trim(inline_options).eq.'-i2') then 115 print*, 'Info mode: provide more detailed run specific information and stop' 116 verbosity=2 117 info_flag=1 118 endif 142 119 endif 143 120 144 121 if (verbosity.gt.0) then 145 print*, 'FLEXPART>******************************'146 print*, 'FLEXPART>* verbosity level:', verbosity147 print*, 'FLEXPART>* info only: ', info_flag148 print*, 'FLEXPART>* time execution: ', time_flag149 print*, 'FLEXPART>******************************'150 151 print*, 'FLEXPART> parameters from par_mod'152 print*, 'FLEXPART> nxmax= ', nxmax153 print*, 'FLEXPART> nymax= ', nymax154 print*, 'FLEXPART> nuvzmax=', nuvzmax155 print*, 'FLEXPART> nwzmax= ', nwzmax156 print*, 'FLEXPART> nzmax= ', nzmax157 print*, 'FLEXPART> nxshift=', nxshift158 print*, 'FLEXPART> maxpart=', maxpart159 print*, 'FLEXPART> maxspec=', maxspec160 161 if (info_flag.eq.1) stop162 122 write(*,*) 'call readpaths' 163 123 endif 164 124 call readpaths(pathfile) 165 125 166 !if (time_flag.gt.1) then !show clock info 126 if (verbosity.gt.1) then !show clock info 127 !print*,'length(4)',length(4) 167 128 !count=0,count_rate=1000 168 CALL SYSTEM_CLOCK(count_clock0, count_rate, count_max)129 CALL SYSTEM_CLOCK(count_clock0, count_rate, count_max) 169 130 !WRITE(*,*) 'SYSTEM_CLOCK',count, count_rate, count_max 170 131 !WRITE(*,*) 'SYSTEM_CLOCK, count_clock0', count_clock0 171 132 !WRITE(*,*) 'SYSTEM_CLOCK, count_rate', count_rate 172 133 !WRITE(*,*) 'SYSTEM_CLOCK, count_max', count_max 173 !endif134 endif 174 135 175 136 ! Read the user specifications for the current model run … … 177 138 178 139 if (verbosity.gt.0) then 179 write(*,*) ' FLEXPART>call readcommand'140 write(*,*) 'call readcommand' 180 141 endif 181 142 call readcommand 182 143 if (verbosity.gt.0) then 183 write(*,*) ' ldirect 184 write(*,*) ' ibdate,ibtime=', 144 write(*,*) ' ldirect=', ldirect 145 write(*,*) ' ibdate,ibtime=',ibdate,ibtime 185 146 write(*,*) ' iedate,ietime=', iedate,ietime 186 endif 187 if (time_flag.gt.0) then 147 if (verbosity.gt.1) then 188 148 CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) 189 149 write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max 190 150 endif 151 endif 191 152 192 153 ! Read the age classes to be used 193 154 !******************************** 194 155 if (verbosity.gt.0) then 195 write(*,*) ' FLEXPART>call readageclasses'156 write(*,*) 'call readageclasses' 196 157 endif 197 158 call readageclasses 198 159 199 if ( time_flag.gt.1) then160 if (verbosity.gt.1) then 200 161 CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) 201 162 write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max … … 206 167 207 168 if (verbosity.gt.0) then 208 write(*,*) ' FLEXPART>call readavailable'169 write(*,*) 'call readavailable' 209 170 endif 210 171 call readavailable … … 215 176 216 177 if (verbosity.gt.0) then 217 write(*,*) 'FLEXPART> call gridcheck' 218 endif 178 write(*,*) 'call gridcheck' 179 endif 180 219 181 call gridcheck 220 182 221 if ( time_flag.gt.0) then183 if (verbosity.gt.1) then 222 184 CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) 223 185 write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max … … 225 187 226 188 if (verbosity.gt.0) then 227 write(*,*) ' FLEXPART>call gridcheck_nests'189 write(*,*) 'call gridcheck_nests' 228 190 endif 229 191 call gridcheck_nests … … 233 195 234 196 if (verbosity.gt.0) then 235 write(*,*) ' FLEXPART>call readoutgrid'197 write(*,*) 'call readoutgrid' 236 198 endif 237 199 … … 241 203 call readoutgrid_nest 242 204 if (verbosity.gt.0) then 243 write(*,*) ' FLEXPART>readoutgrid_nest'205 write(*,*) '# readoutgrid_nest' 244 206 endif 245 207 endif … … 249 211 250 212 if (verbosity.eq.1) then 251 print*,' FLEXPART>call readreceptors'213 print*,'call readreceptors' 252 214 endif 253 215 call readreceptors … … 263 225 264 226 if (verbosity.gt.0) then 265 print*,' FLEXPART>call readlanduse'227 print*,'call readlanduse' 266 228 endif 267 229 call readlanduse … … 271 233 272 234 if (verbosity.gt.0) then 273 print*,' FLEXPART>call assignland'235 print*,'call assignland' 274 236 endif 275 237 call assignland … … 279 241 280 242 if (verbosity.gt.0) then 281 print*,' FLEXPART>call readreleases'243 print*,'call readreleases' 282 244 endif 283 245 call readreleases … … 287 249 288 250 if (verbosity.gt.0) then 289 print*,' FLEXPART>call readdepo'251 print*,'call readdepo' 290 252 endif 291 253 call readdepo … … 296 258 call coordtrafo 297 259 if (verbosity.gt.0) then 298 print*,' FLEXPART>call coordtrafo'260 print*,'call coordtrafo' 299 261 endif 300 262 … … 303 265 304 266 if (verbosity.gt.0) then 305 print*,' FLEXPART>Initialize all particles to non-existent'267 print*,'Initialize all particles to non-existent' 306 268 endif 307 269 do j=1,maxpart … … 314 276 if (ipin.eq.1) then 315 277 if (verbosity.gt.0) then 316 print*,' FLEXPART>call readpartpositions'278 print*,'call readpartpositions' 317 279 endif 318 280 call readpartpositions 319 281 else 320 282 if (verbosity.gt.0) then 321 print*,' FLEXPART> setnumpart=0, numparticlecount=0'283 print*,'numpart=0, numparticlecount=0' 322 284 endif 323 285 numpart=0 … … 330 292 331 293 if (verbosity.gt.0) then 332 print*,' FLEXPART>call outgrid_init'294 print*,'call outgrid_init' 333 295 endif 334 296 call outgrid_init … … 340 302 if (OHREA.eqv..TRUE.) then 341 303 if (verbosity.gt.0) then 342 print*,' FLEXPART>call readOHfield'304 print*,'call readOHfield' 343 305 endif 344 306 call readOHfield 345 307 endif 308 309 !! testing !! 310 ! open(999,file=trim(path(1))//'OH_FIELDS/jscalar_50N.txt',action='write',status='new') 311 ! open(998,file=trim(path(1))//'OH_FIELDS/jscalar_50S.txt',action='write',status='new') 312 346 313 347 314 ! Write basic information on the simulation to a file "header" … … 349 316 !****************************************************************** 350 317 351 if (verbosity.gt.0) then 352 print*,'FLEXPART> call variuos writeheader routines' 318 if (lnetcdfout.eq.1) then 319 call writeheader_netcdf(lnest=.false.) 320 else 321 call writeheader 322 end if 323 324 if (nested_output.eq.1) then 325 if (lnetcdfout.eq.1) then 326 call writeheader_netcdf(lnest=.true.) 327 else 328 call writeheader_nest 329 endif 330 endif 331 332 if (verbosity.gt.0) then 333 print*,'call writeheader' 353 334 endif 354 335 355 336 call writeheader 356 ! write header in ASCII format337 ! FLEXPART 9.2 ticket ?? write header in ASCII format 357 338 call writeheader_txt 358 339 !if (nested_output.eq.1) call writeheader_nest … … 364 345 365 346 if (verbosity.gt.0) then 366 print*,' FLEXPART>call openreceptors'347 print*,'call openreceptors' 367 348 endif 368 349 call openreceptors … … 373 354 374 355 if (verbosity.gt.0) then 375 print*,' FLEXPART>discretize release times'356 print*,'discretize release times' 376 357 endif 377 358 do i=1,numpoint … … 384 365 385 366 if (verbosity.gt.0) then 386 print*,' FLEXPART>Initialize cloud-base mass fluxes for the convection scheme'367 print*,'Initialize cloud-base mass fluxes for the convection scheme' 387 368 endif 388 369 … … 403 384 !******************************** 404 385 405 if ( time_flag.gt.0) then406 CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)407 write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max408 endif409 if (info_flag.eq.2) then410 print*, 'FLEXPART> info only mode (stop before call timemanager)'411 stop412 endif413 if (verbosity.gt.0) then414 print*,' FLEXPART>call timemanager'386 if (verbosity.gt.0) then 387 if (verbosity.gt.1) then 388 CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) 389 write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max 390 endif 391 if (info_flag.eq.1) then 392 print*, 'info only mode (stop)' 393 stop 394 endif 395 print*,'call timemanager' 415 396 endif 416 397 417 398 call timemanager 418 399 419 write(*,*) 'CONGRATULATIONS: YOU HAVE SUCCESSFULLY COMPLETED A FLEXPART MODEL RUN!' 400 ! NIK 16.02.2005 401 write(*,*) '**********************************************' 402 write(*,*) 'Total number of occurences of below-cloud scavenging', tot_blc_count 403 write(*,*) 'Total number of occurences of in-cloud scavenging', tot_inc_count 404 write(*,*) '**********************************************' 405 406 write(*,*) 'CONGRATULATIONS: YOU HAVE SUCCESSFULLY COMPLETED A FLE& 407 &XPART MODEL RUN!' 420 408 421 409 end program flexpart
Note: See TracChangeset
for help on using the changeset viewer.