Ignore:
Timestamp:
Jan 9, 2013, 5:49:56 PM (12 years ago)
Author:
tnavarro
Message:

Modification to create large files, that is to say with at least 2 variables > 2GiB. In that case, it is necessary to have an unlimited dimension.

File:
1 edited

Legend:

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

    r829 r860  
    5959! EM 11/2012 : Adapted so it can be used on "generic" model outputs; planet
    6060!              constants (radius, R, etc.) are now read from file
     61! TN 01/2013 : Adapted for large output files with at least 2 variables > 2 GiB
     62!
    6163implicit none
    6264
     
    138140logical :: auto_mcd_levels ! Flag: specific case for MCD automatic above
    139141                           ! local surface levels
     142integer,dimension(4) :: edges,corner ! needed to write variables for big files
     143
    140144!===============================================================================
    141145! 1. Input parameters
     
    10191023
    10201024! time
    1021 ierr=NF_DEF_DIM(outfid,"Time",timelength,time_dimid)
     1025ierr=NF_DEF_DIM(outfid,"Time",NF_UNLIMITED,time_dimid)
    10221026if (ierr.ne.NF_NOERR) then
    10231027  write(*,*) "Error: Could not define Time dimension"
     
    15061510
    15071511! Write time
    1508 ierr=NF_PUT_VAR_REAL(outfid,time_varid,time)
     1512ierr=NF_PUT_VARA_REAL(outfid,time_varid,1,timelength,time)
    15091513if (ierr.ne.NF_NOERR) then
    15101514  write(*,*) "Error: Could not write Time data to output file"
     
    15181522
    15191523! Write surface pressure
    1520 
    1521 ierr=NF_PUT_VAR_REAL(outfid,ps_varid,ps)
     1524corner(:)=1
     1525edges(1)=lonlength
     1526edges(2)=latlength
     1527edges(3)=timelength
     1528ierr=NF_PUT_VARA_REAL(outfid,ps_varid,corner(1:3),edges(1:3),ps)
    15221529if (ierr.ne.NF_NOERR) then
    15231530  write(*,*) "Error: Could not write ps data to output file"
     
    15811588                      miss_val,ps,press,za_gcm,plevel,outdata)
    15821589  ! write result to output file
    1583   ierr=NF_PUT_VAR_REAL(outfid,za_varid,outdata)
     1590  corner(:)=1
     1591  edges(1)=lonlength
     1592  edges(2)=latlength
     1593  edges(3)=nblev
     1594  edges(4)=timelength
     1595  ierr=NF_PUT_VARA_REAL(outfid,var_id(i),corner,edges,outdata)
    15841596  if (ierr.ne.NF_NOERR) then
    15851597    write(*,*) "Error, Failed to write zareoid to output file"
Note: See TracChangeset for help on using the changeset viewer.