Ignore:
Timestamp:
Sep 13, 2011, 9:19:35 AM (13 years ago)
Author:
emillour
Message:

Update of Mars GCM tool 'extract': extracted values are now sent to an ASCII output file ('infile_var.dat', where 'inifil' is the input file name and 'var' is the extracted variable).
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/util/extract.F90

    r282 r293  
    1818!         coordinate in the input file), one per line, at which values are
    1919!         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)
    2224!   as lines of "alt value"
    2325!
     
    3335! Input file:
    3436character(len=256) :: infile
     37character(len=256) :: outfile
    3538
    3639character (len=64) :: text ! to store some text
     
    310313! 2. Process and interpolate
    311314!===============================================================================
     315
     316!===============================================================================
     317! 2.1 Create output file
     318!===============================================================================
     319
     320outfile=trim(infile(1:index(infile,".nc",back=.true.)-1))//"_"//&
     321        trim(varname)//".dat"
     322open(42,file=outfile,form="formatted")
     323write(*,*) "Output file is: ",trim(outfile)
     324
     325!===============================================================================
     326! 2.2 Extract values
     327!===============================================================================
     328
    312329if (extract_mode==1) then ! pointwise extraction
    313330 write(*,*) " Enter values of: lon lat alt Ls LT (all on the same line,"
     
    370387  ! 2.4 Write value to output
    371388  if (extract_mode==1) then ! pointwise extraction
    372     write(*,'(6(1x,1pe12.5))')lon,lat,alt,Ls,LT,value
     389    write(42,'(6(1x,1pe12.5))')lon,lat,alt,Ls,LT,value
    373390  else ! profile
    374     write(*,'(6(1x,1pe12.5))')alt,value
     391    write(42,'(6(1x,1pe12.5))')alt,value
    375392  endif
    376393enddo ! of do while
    377394
     395! close output file
     396close(42)
    378397
    379398end program extract
Note: See TracChangeset for help on using the changeset viewer.