Ignore:
Timestamp:
May 7, 2020, 9:58:54 PM (5 years ago)
Author:
abierjon
Message:

Mars GCM:
Following r2303 and r2308 and truly truly resolving Ticket #46 on concatnc:
Improved ergonomics of the user interface, with no more request to the user
in the midst of computations

AB

File:
1 edited

Legend:

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

    r2308 r2313  
    157157write(*,*) "Starting day to be stored in the output file time axis?"
    158158write(*,*) "(e.g.: 100 if you want the output file to start at time=100 sols)"
    159 read(*,*) starttimeoffset
     159write(*,*) "Your answer will bypass any starting day value stored in the 1st"
     160write(*,*) "input file. Conversely, just type return if you want this 1st file's"
     161write(*,*) "value to be kept for the output file starting day."
     162read(*,*,iostat=ierr) starttimeoffset
     163if (ierr.ne.0) then
     164   ! if nothing or a character that is not a float is read
     165   write(*,*) "1st input file's starting day will serve as starting day for the outfile."
     166   firstsol='n'
     167else ! if the user gave a number
     168   write(*,*) "Your input day will serve as starting day for the outfile."
     169   firstsol='y'
     170endif
    160171
    161172!==============================================================================
     
    287298endif ! of if (tmpvar=="all")
    288299
    289 ! Name of the new file
    290 !==========================================================
    291 !filename=var(1)
    292 !do i=2, nbvar
    293 !   filename=trim(adjustl(filename))//"_"//var(i)
    294 !enddo
    295 !filename=trim(adjustl(filename))//".nc"
    296300
    297301!==============================================================================
     
    450454      ierr = NF_GET_VAR_REAL(nid,altvar,alt)
    451455#endif
    452       firstsol = 'n' ! defaut value
    453456      write(*,*)
    454457      if (ctllen .ne. 0) then
    455458         if (int(starttimeoffset) .ne. (int(ctlsol)+int(time(1))) ) then
    456459           write(*,*) "WARNING: Starting day of the first file is not ",&
    457                                 int(starttimeoffset)," but ",int(ctlsol)+int(time(1)),"!"
    458            write(*,*) "Answer:"
    459            write(*,*) " y to use the starting day you have inputted"
    460            write(*,*) " n to keep the starting day of the first file"
    461            write(*,*) "as the starting day of the output file"
    462            read(*,*) firstsol
     460                       int(starttimeoffset)," but ",int(ctlsol)+int(time(1)),"!"
    463461         endif
    464          
     462       
    465463         if (firstsol.eq.'y') then
    466            write(*,*) "The day given by the user is used as the starting day of the ouput file"
    467464           starttimeoffset = float(int(ctlsol)+int(time(1))) + ctl(27) - starttimeoffset
    468          else ! if firstsol.eq.'n' or other (default case, for retrocompatibility with previous concatnc.def)
    469            write(*,*) "The starting day of the 1st file is used as the starting day of the ouput file"
     465         else ! if firstsol.eq.'n'
    470466           starttimeoffset = 0
    471467         endif
    472          
     468
    473469         memotime=float(int(ctlsol)+int(time(1))) + ctl(27)
    474470         ctl(4) = 0.  ! values written in the output
     
    478474         if (int(starttimeoffset) .ne. (int(time(1))) ) then
    479475           write(*,*) "WARNING: Starting day of the first file is not ",&
    480                                 int(starttimeoffset)," but ",int(time(1)),"!"
    481            write(*,*) "Answer:"
    482            write(*,*) " y to use the starting day you have inputted"
    483            write(*,*) " n to keep the starting day of the first file"
    484            write(*,*) "as the starting day of the output file"
    485            read(*,*) firstsol
     476                       int(starttimeoffset)," but ",int(time(1)),"!"
    486477         endif
    487          
     478
    488479         if (firstsol.eq.'y') then
    489            write(*,*) "The day given by the user is used as the starting day of the ouput file"
    490480           starttimeoffset = int(time(1)) - starttimeoffset
    491          else ! if firstsol.eq.'n' or other (default case, for retrocompatibility with previous concatnc.def)
    492            write(*,*) "The starting day of the 1st file is used as the starting day of the ouput file"
     481         else ! if firstsol.eq.'n'
    493482           starttimeoffset = 0
    494483         endif
     
    499488   ! Initialize output file's lat,lon,alt and time dimensions
    500489      write(*,*)
    501       call initiate (filename,lat,lon,alt,ctl,GCM_layers,nout,&
     490      call initiate(filename,lat,lon,alt,ctl,GCM_layers,nout,&
    502491       latdimout,londimout,altdimout,timedimout,&
    503492       layerdimout,interlayerdimout,timevarout,axis)
Note: See TracChangeset for help on using the changeset viewer.