Changeset 293 for trunk/LMDZ.MARS/util/extract.F90
- Timestamp:
- Sep 13, 2011, 9:19:35 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/extract.F90
r282 r293 18 18 ! coordinate in the input file), one per line, at which values are 19 19 ! sought 20 ! - output values are given on standard output; with extraction mode 1 as 21 ! lines of "lon lat alt Ls LT value" an for a profile (extraction mode 2) 20 ! - output values are sent to (ASCII) output file 'infile_var_.dat', where 21 ! 'infile' is the input file name (without trailing '.nc') and 22 ! 'var' is the sought variable, for extraction mode 1 as 23 ! lines of "lon lat alt Ls LT value" and for a profile (extraction mode 2) 22 24 ! as lines of "alt value" 23 25 ! … … 33 35 ! Input file: 34 36 character(len=256) :: infile 37 character(len=256) :: outfile 35 38 36 39 character (len=64) :: text ! to store some text … … 310 313 ! 2. Process and interpolate 311 314 !=============================================================================== 315 316 !=============================================================================== 317 ! 2.1 Create output file 318 !=============================================================================== 319 320 outfile=trim(infile(1:index(infile,".nc",back=.true.)-1))//"_"//& 321 trim(varname)//".dat" 322 open(42,file=outfile,form="formatted") 323 write(*,*) "Output file is: ",trim(outfile) 324 325 !=============================================================================== 326 ! 2.2 Extract values 327 !=============================================================================== 328 312 329 if (extract_mode==1) then ! pointwise extraction 313 330 write(*,*) " Enter values of: lon lat alt Ls LT (all on the same line," … … 370 387 ! 2.4 Write value to output 371 388 if (extract_mode==1) then ! pointwise extraction 372 write( *,'(6(1x,1pe12.5))')lon,lat,alt,Ls,LT,value389 write(42,'(6(1x,1pe12.5))')lon,lat,alt,Ls,LT,value 373 390 else ! profile 374 write( *,'(6(1x,1pe12.5))')alt,value391 write(42,'(6(1x,1pe12.5))')alt,value 375 392 endif 376 393 enddo ! of do while 377 394 395 ! close output file 396 close(42) 378 397 379 398 end program extract
Note: See TracChangeset
for help on using the changeset viewer.