Changeset 2147


Ignore:
Timestamp:
Jul 16, 2019, 12:36:42 PM (5 years ago)
Author:
emillour
Message:

Mars GCM utilities:
Add the information in concat when time axis is set to "Solar longitude", and try to check in localtime that the input time axis in indeed in sols.
EM

Location:
trunk/LMDZ.MARS/util
Files:
3 edited

Legend:

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

    r1118 r2147  
    404404      call initiate (filename,lat,lon,alt,ctl,GCM_layers,nout,&
    405405       latdimout,londimout,altdimout,timedimout,&
    406        layerdimout,interlayerdimout,timevarout)
     406       layerdimout,interlayerdimout,timevarout,axis)
    407407   ! Initialize output file's aps,bps,ap,bp and phisinit variables
    408408     call init2(nid,lonlen,latlen,altlen,GCM_layers,&
     
    619619subroutine initiate (filename,lat,lon,alt,ctl,GCM_layers,nout,&
    620620         latdimout,londimout,altdimout,timedimout,&
    621          layerdimout,interlayerdimout,timevarout)
     621         layerdimout,interlayerdimout,timevarout,axis)
    622622!==============================================================================
    623623! Purpose:
     
    662662integer, intent(out):: timevarout
    663663! timevarout: [netcdf] "Time" (considered as a variable) ID
     664character (len=4),intent(in) :: axis
     665! axis: "ls" or "sol"
    664666
    665667!==============================================================================
     
    701703! 3. Write "Time" and its attributes
    702704!==============================================================================
    703 
    704 call def_var(nout,"Time","Time","years since 0000-00-0 00:00:00",1,&
     705if (axis=="sol") then
     706  call def_var(nout,"Time","Time","days since 0000-00-0 00:00:00",1,&
    705707             (/timedimout/),timevarout,ierr)
    706 
     708else ! Ls
     709  call def_var(nout,"Time","Solar longitude","days since 0000-00-0 00:00:00",1,&
     710             (/timedimout/),timevarout,ierr)
     711endif
    707712!==============================================================================
    708713! 4. Write "latitude" (data and attributes)
  • trunk/LMDZ.MARS/util/concatnc.def

    r137 r2147  
    44
    55515              ! Starting sol of the run stored in the first input file?
    6 sol              ! output timescale ("sol" or "Ls")
     6sol              ! output timescale ("sol" or "ls")
    77tsurf           
    88ps
  • trunk/LMDZ.MARS/util/localtime.F90

    r2118 r2147  
    302302!  write(*,*) "timelen: ",timelen
    303303
     304   ! Sanity Check: Does "Time" has a "title" attribute
     305   ! and is it "Solar longitude" ?
     306   ierr=nf_get_att_text(nid,timevar,"title",title)
     307   if ((ierr.EQ.NF_NOERR).and.(title.eq."Solar longitude")) then
     308     write(*,*) "ERROR: Time axis in input file is in Solar Longitude!"
     309     write(*,*) "       localtime requires sols as time axis!"
     310     write(*,*) " Might as well stop here."
     311     stop
     312   endif
     313
    304314   ! allocate time() array and fill it with values from input file
    305315   allocate(time(timelen))
     
    310320   ierr = NF_GET_VAR_REAL(nid,timevar,time)
    311321#endif
     322   if (ierr.NE.NF_NOERR) then
     323     write(*,*) "Error , failed to load Time"
     324     stop
     325   endif
    312326
    313327
     
    396410        ierr= NF_PUT_VARA_REAL(nout,timevarout,it,1,lt_out(it))
    397411#endif
     412        if (ierr.NE.NF_NOERR) then
     413          write(*,*) "Error , failed to write Time"
     414          stop
     415        endif
    398416     enddo
    399417  end if
Note: See TracChangeset for help on using the changeset viewer.