Changeset 1955


Ignore:
Timestamp:
Jun 27, 2018, 12:41:02 PM (6 years ago)
Author:
emillour
Message:

Mars GCM:

  • Fix problematic writediagfi call in physiq (should not write a "Time" variable as "Time" is already defined as a dimension) and added some extra tests in writediagfi to better detect similar issues.

EM

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r1954 r1955  
    25922592== 21/06/2018 == EM
    25932593- Make a "doc" subdirectory to store the documentation source files with the code
     2594
     2595== 27/06/2018 == EM
     2596- Fix problematic writediagfi call in physiq (should not write a "Time" variable
     2597  as "Time" is already defined as a dimension) and added some extra tests in
     2598  writediagfi to better detect similar issues.
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r1944 r1955  
    23292329     &                  fluxtop_sw_tot)
    23302330         call WRITEDIAGFI(ngrid,"temp","temperature","K",3,zt)
    2331          call WRITEDIAGFI(ngrid,"Time","Time","sols",0,zday)
     2331         call WRITEDIAGFI(ngrid,"Sols","Time","sols",0,zday)
    23322332
    23332333         call WRITEDIAGFI(ngrid,"u","Zonal wind","m.s-1",3,zu)
  • trunk/LMDZ.MARS/libf/phymars/writediagfi.F

    r1543 r1955  
    281281           ntime=ntime+1 ! increment # of stored time steps
    282282           ! compute corresponding date (in days and fractions thereof)
    283            date= float (zitau +1)/float (day_step)
     283           date=(zitau +1.)/day_step
    284284           ! Get NetCDF ID of 'Time' variable
    285285           ierr= NF_INQ_VARID(nid,"Time",varid)
     
    293293              write(*,*) "***** PUT_VAR matter in writediagfi_nc"
    294294              write(*,*) "***** with time"
    295               write(*,*) 'ierr=', ierr  
     295              write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr) 
    296296c             call abort
    297297           endif
     
    355355
    356356              write (*,*) "=========================="
    357               write (*,*) "DIAGFI: creating variable ",nom
     357              write (*,*) "DIAGFI: creating variable ",trim(nom)
    358358              call def_var(nid,nom,titre,unite,4,id,varid,ierr)
    359359
     360           else
     361             if (ntime==0) then
     362              write(*,*) "DIAGFI Error: failed creating variable ",
     363     &                   trim(nom)
     364              write(*,*) "it seems it already exists!"
     365              stop
     366             endif
    360367           endif
    361368
     
    389396           if (ierr.ne.NF_NOERR) then
    390397              write(*,*) "***** PUT_VAR problem in writediagfi"
    391               write(*,*) "***** with dx3: ",nom
     398              write(*,*) "***** with dx3: ",trim(nom)
    392399              write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
    393400              stop
     
    449456
    450457              write (*,*) "=========================="
    451               write (*,*) "DIAGFI: creating variable ",nom
     458              write (*,*) "DIAGFI: creating variable ",trim(nom)
    452459
    453460              call def_var(nid,nom,titre,unite,3,id,varid,ierr)
    454461
     462           else
     463             if (ntime==0) then
     464              write(*,*) "DIAGFI Error: failed creating variable ",
     465     &                   trim(nom)
     466              write(*,*) "it seems it already exists!"
     467              stop
     468             endif
    455469           endif
    456470
     
    479493           if (ierr.ne.NF_NOERR) then
    480494              write(*,*) "***** PUT_VAR matter in writediagfi"
    481               write(*,*) "***** with dx2: ",nom
     495              write(*,*) "***** with dx2: ",trim(nom)
    482496              write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
    483497              stop
     
    510524
    511525              write (*,*) "=========================="
    512               write (*,*) "DIAGFI: creating variable ",nom
     526              write (*,*) "DIAGFI: creating variable ",trim(nom)
    513527
    514528              call def_var(nid,nom,titre,unite,2,id,varid,ierr)
    515529             
     530           else
     531             if (ntime==0) then
     532              write(*,*) "DIAGFI Error: failed creating variable ",
     533     &                   trim(nom)
     534              write(*,*) "it seems it already exists!"
     535              stop
     536             endif
    516537           endif
    517538           
     
    529550           if (ierr.ne.NF_NOERR) then
    530551              write(*,*) "***** PUT_VAR problem in writediagfi"
    531               write(*,*) "***** with dx1: ",nom
     552              write(*,*) "***** with dx1: ",trim(nom)
    532553              write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
    533554              stop
     
    551572
    552573              write (*,*) "=========================="
    553               write (*,*) "DIAGFI: creating variable ",nom
     574              write (*,*) "DIAGFI: creating variable ",trim(nom)
    554575
    555576              call def_var(nid,nom,titre,unite,1,id,varid,ierr)
    556577
     578           else
     579             if (ntime==0) then
     580              write(*,*) "DIAGFI Error: failed creating variable ",
     581     &                   trim(nom)
     582              write(*,*) "it seems it already exists!"
     583              stop
     584             endif
    557585           endif
    558586
     
    567595           if (ierr.ne.NF_NOERR) then
    568596              write(*,*) "***** PUT_VAR matter in writediagfi"
    569               write(*,*) "***** with dx0: ",nom
     597              write(*,*) "***** with dx0: ",trim(nom)
    570598              write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
    571599              stop
Note: See TracChangeset for help on using the changeset viewer.