Changeset 3694


Ignore:
Timestamp:
Mar 18, 2025, 3:52:13 PM (5 months ago)
Author:
afalco
Message:

Pluto: xios-linked changes, some new variables;
zrecast reads aps and bps in start.nc if it fails to find it in Xhistins.nc.
AF

Location:
trunk/LMDZ.PLUTO
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/deftank/xios/file_def_physics.xml

    r3692 r3694  
    2929            </field_group>
    3030
    31             <field_group  operation="instant"
     31            <field_group  operation="once"
    3232                          grid_ref="altitude_grid"
    3333                          freq_op="1ts">
     
    4444                           freq_op="1ts">
    4545                  <field field_ref="area" operation="once" />
     46                  <field field_ref="phisfi" operation="once" />
    4647                  <field field_ref="ps" enabled="true" />
    4748                  <field field_ref="ISR" enabled="true" />
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3692 r3694  
    21292129      call write_output("ps","Surface pressure","Pa",ps)
    21302130      call write_output("emis","Emissivity","",emis)
     2131      call write_output('phisfi','Surface Geopotential','m2s-2',phisfi)
    21312132      if (grid_type == regular_lonlat) then
    21322133          call write_output("area","Mesh area","m2", &
     
    21682169         call write_output("zzlay","Midlayer altitude", "m",zzlay(:,:))
    21692170         call write_output("zzlev","Interlayer altitude", "m",zzlev(:,1:nlayer))
    2170          !call write_output('pphi','Geopotential',' ',pphi)
     2171         call write_output('pphi','Geopotential','m2s-2',pphi)
    21712172
    21722173         call write_output("temperature","temperature","K",zt)
  • trunk/LMDZ.PLUTO/util/zrecast_plut.F90

    r3623 r3694  
    356356  ierr=NF_INQ_DIMID(infid,"time",tmpdimid)
    357357  if (ierr.ne.NF_NOERR) then
    358     stop "Error: Failed to get lon dimension ID"
    359   else
    360     ierr=NF_INQ_VARID(infid,"time",tmpvarid)
     358    write(*,*) "Could not get time dimension ID"
     359    write(*,*) "  looking for time_counter dimension instead... "
     360    ierr=NF_INQ_DIMID(infid,"time_counter",tmpdimid)
    361361    if (ierr.ne.NF_NOERR) then
    362       stop "Error: Failed to get time ID"
     362      stop "Error: Failed to get time/Time/time_counter dimension ID"
    363363    else
    364       ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
     364      ierr=NF_INQ_VARID(infid,"time",tmpvarid)
    365365      if (ierr.ne.NF_NOERR) then
    366         stop "Error: Failed to get time length"
     366        ierr=NF_INQ_VARID(infid,"time_instant",tmpvarid)
     367      endif
     368      if (ierr.ne.NF_NOERR) then
     369        stop "Error: Failed to get time ID"
    367370      else
    368         allocate(time(timelength),stat=ierr)
    369         if (ierr.ne.0) then
    370           write(*,*) "Error: Failed to allocate time(timelength)"
    371           write(*,*) "     timelength=",timelength
    372           stop
    373         endif
    374         ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
     371        ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
    375372        if (ierr.ne.NF_NOERR) then
    376           stop "Error: Failed reading time"
     373          stop "Error: Failed to get time length"
     374        else
     375          allocate(time(timelength),stat=ierr)
     376          if (ierr.ne.0) then
     377            write(*,*) "Error: Failed to allocate time(timelength)"
     378            write(*,*) "     timelength=",timelength
     379            stop
     380          endif
     381          ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
     382          if (ierr.ne.NF_NOERR) then
     383            stop "Error: Failed reading time"
     384          endif
    377385        endif
    378386      endif
     
    449457  ierr=NF_INQ_VARID(infid,"aps",tmpvarid)
    450458  if (ierr.ne.NF_NOERR) then
    451     stop "Error: Failed to get aps ID"
     459    write(*,*) "Problem: Could not find aps"
     460    infile2="start.nc"
     461    write(*,*) "         Trying file ",trim(infile2)
     462    ierr=NF_OPEN(infile2,NF_NOWRITE,infid2)
     463    if (ierr.ne.NF_NOERR) then
     464      write(*,*) "Error: Could not open that file either"
     465      stop "Might as well stop here"
     466    endif
    452467  else
    453     allocate(aps(altlength),stat=ierr)
    454     if (ierr.ne.0) then
    455       write(*,*) "Error: Failed to allocate aps(altlength)"
    456       write(*,*) "     altlength=",altlength
    457       stop
    458     endif
    459     ierr=NF_GET_VAR_REAL(infid,tmpvarid,aps)
    460     if (ierr.ne.NF_NOERR) then
    461       stop "Error: Failed reading aps"
    462     endif
     468    ! reopen file using infid2
     469    ierr=NF_OPEN(infile,NF_NOWRITE,infid2)
    463470  endif
     471
     472  ierr=NF_INQ_VARID(infid2,"aps",tmpvarid)
     473  if (ierr.ne.NF_NOERR) then
     474      stop "Error: Failed to get aps ID"
     475  endif
     476
     477  allocate(aps(altlength),stat=ierr)
     478  if (ierr.ne.0) then
     479    write(*,*) "Error: Failed to allocate aps(altlength)"
     480    write(*,*) "     altlength=",altlength
     481    stop
     482  endif
     483  ierr=NF_GET_VAR_REAL(infid2,tmpvarid,aps)
     484  if (ierr.ne.NF_NOERR) then
     485    stop "Error: Failed reading aps"
     486  endif
     487
     488  write(*,*) 'OK, got aps'
     489  ierr=NF_CLOSE(infid2)
    464490
    465491  ! hybrid coordinate bps
    466492  ierr=NF_INQ_VARID(infid,"bps",tmpvarid)
    467493  if (ierr.ne.NF_NOERR) then
    468     stop "Error: Failed to get bps ID"
     494    write(*,*) "Problem: Could not find bps"
     495    infile2="start.nc"
     496    write(*,*) "         Trying file ",trim(infile2)
     497    ierr=NF_OPEN(infile2,NF_NOWRITE,infid2)
     498    print*, "here"
     499    if (ierr.ne.NF_NOERR) then
     500      write(*,*) "Error: Could not open that file either"
     501      stop "Might as well stop here"
     502    endif
    469503  else
    470     allocate(bps(altlength),stat=ierr)
    471     if (ierr.ne.0) then
    472       write(*,*) "Error: Failed to allocate bps(altlength)"
    473       write(*,*) "     altlength=",altlength
    474       stop
    475     endif
    476     ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    477     if (ierr.ne.NF_NOERR) then
    478       stop "Error: Failed reading bps"
    479     endif
     504    ! reopen file using infid2
     505    ierr=NF_OPEN(infile,NF_NOWRITE,infid2)
    480506  endif
     507
     508  ierr=NF_INQ_VARID(infid2,"bps",tmpvarid)
     509  if (ierr.ne.NF_NOERR) then
     510      stop "Error: Failed to get bps ID"
     511  endif
     512
     513  allocate(bps(altlength),stat=ierr)
     514  if (ierr.ne.0) then
     515    write(*,*) "Error: Failed to allocate bps(altlength)"
     516    write(*,*) "     altlength=",altlength
     517    stop
     518  endif
     519  ierr=NF_GET_VAR_REAL(infid2,tmpvarid,bps)
     520  if (ierr.ne.NF_NOERR) then
     521    stop "Error: Failed reading bps"
     522  endif
     523
     524  write(*,*) 'OK, got bps'
     525  ierr=NF_CLOSE(infid2)
    481526endif !of if (.not.have_sigma)
    482527
     
    498543  if (ierr.ne.NF_NOERR) then
    499544    write(*,*) "Problem: Could not find/open that file"
    500     infile2="phisinit.nc"
     545    infile2="startfi.nc"
    501546    write(*,*) "         Trying file ",trim(infile2)
    502547    ierr=NF_OPEN(infile2,NF_NOWRITE,infid2)
     
    510555  ierr=NF_INQ_VARID(infid2,"phisinit",tmpvarid)
    511556  if (ierr.ne.NF_NOERR) then
    512     stop "Error: Failed to get phisinit ID"
     557    ierr=NF_INQ_VARID(infid2,"phisfi",tmpvarid)
     558    if (ierr.ne.NF_NOERR) then
     559      stop "Error: Failed to get phisinit/phisfi ID"
     560    endif
    513561  endif
    514562  ! Get physinit
     
    773821endif
    774822
    775 ierr=NF_INQ_VARID(infid,"temp",tmpvarid)
     823ierr=NF_INQ_VARID(infid,"temperature",tmpvarid)
    776824if (ierr.ne.NF_NOERR) then
    777825  ! stop "Error: Failed to get temp ID"
     
    779827  ierr=NF_INQ_VARID(infid,"t",tmpvarid)
    780828  if (ierr.ne.NF_NOERR) then
    781    !  stop "Error: Failed to get t ID"
    782     ierr=NF_INQ_VARID(infid,"temperature",tmpvarid)
    783     if (ierr.ne.NF_NOERR) then
    784       stop "Error: Failed to get temperature ID"
    785     endif
     829    stop "Error: Failed to get t ID"
    786830  else
    787831    ierr=NF_GET_VAR_REAL(infid,tmpvarid,temp)
     
    13221366    if (ierr.ne.NF_NOERR) then
    13231367      write(*,*) "Error failed to copy long_name attribute:",trim(text)
    1324       stop ""
     1368      stop " "
    13251369    endif
    13261370  endif
     
    13361380    if (ierr.ne.NF_NOERR) then
    13371381      write(*,*) "Error failed to copy units attribute:",trim(text)
    1338       stop ""
     1382      stop " "
    13391383    endif
    13401384  endif
Note: See TracChangeset for help on using the changeset viewer.