Changeset 1984 for LMDZ5


Ignore:
Timestamp:
Feb 18, 2014, 10:59:29 AM (11 years ago)
Author:
Ehouarn Millour
Message:

Cleanup and update of "grilles_gcm_netcdf_sub": removed old version, removed flag "grilles_gcm_netcdf" used to trigger output of grilles_gcm.nc file (file will now always be created) and fixed writing vertical levels presnivs in the file.
JBM+EM

Location:
LMDZ5/trunk/libf
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3d/ce0l.F90

    r1907 r1984  
    9494  END IF
    9595
    96   IF (grilles_gcm_netcdf) THEN
    97      WRITE(lunout,'(//)')
    98      WRITE(lunout,*) '  ***************************  '
    99      WRITE(lunout,*) '  ***  grilles_gcm_netcdf ***  '
    100      WRITE(lunout,*) '  ***************************  '
    101      WRITE(lunout,'(//)')
    102      CALL grilles_gcm_netcdf_sub(masque,phis)
    103   END IF
     96 
     97  WRITE(lunout,'(//)')
     98  WRITE(lunout,*) '  ***************************  '
     99  WRITE(lunout,*) '  ***  grilles_gcm_netcdf ***  '
     100  WRITE(lunout,*) '  ***************************  '
     101  WRITE(lunout,'(//)')
     102  CALL grilles_gcm_netcdf_sub(masque,phis)
     103
    104104#endif
    105105! of #ifndef CPP_EARTH #else
  • LMDZ5/trunk/libf/dyn3d/conf_gcm.F

    r1907 r1984  
    890890      ok_etat0 = .TRUE.
    891891      CALL getin('ok_etat0',ok_etat0)
    892 
    893 !Config  Key  = grilles_gcm_netcdf
    894 !Config  Desc = creation de fichier grilles_gcm.nc dans create_etat0_limit
    895 !Config  Def  = n
    896       grilles_gcm_netcdf = .FALSE.
    897       CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf)
    898892
    899893      write(lunout,*)' #########################################'
     
    943937      write(lunout,*)' ok_limit = ', ok_limit
    944938      write(lunout,*)' ok_etat0 = ', ok_etat0
    945       write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf
    946939c
    947940      RETURN
  • LMDZ5/trunk/libf/dyn3d/logic.h

    r1907 r1984  
    1111     &  statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus       &
    1212     &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    13      &  ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid
     13     &  ,ok_limit,ok_etat0,hybrid
    1414
    1515      COMMON/logici/ iflag_phys,iflag_trac
     
    1818     & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus                      &
    1919     &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    20      &  ,ok_limit,ok_etat0,grilles_gcm_netcdf
     20     &  ,ok_limit,ok_etat0
     21     
    2122      logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
    2223                     ! (only used if disvert_type==2)
  • LMDZ5/trunk/libf/dyn3d_common/grilles_gcm_netcdf_sub.F90

    r1952 r1984  
    11!
    2 ! $Header$
     2! $Id: $
    33!
    44! This subroutine creates the file grilles_gcm.nc containg longitudes and
    55! latitudes in degrees for grid u and v. This subroutine is called from
    6 ! ce0l if grilles_gcm_netcdf=TRUE. This subroutine corresponds to the first
     6! ce0l. This subroutine corresponds to the first
    77! part in the program create_fausse_var.
    88!
     
    4848  INTEGER :: area_id
    4949  INTEGER :: mask_id
     50  INTEGER :: presnivs_id
    5051 
    5152  rad = 6400000
     
    8081  ! CREATION OUTPUT
    8182  ! ouverture fichier netcdf de sortie out
    82   status=NF_CREATE('grilles_gcm.nc',NF_NOCLOBBER,ncid_out)
     83  status=NF_CREATE('grilles_gcm.nc',NF_CLOBBER,ncid_out)
     84  CALL handle_err(status)
    8385  status=NF_DEF_DIM(ncid_out,'lonu',iim+1,out_lonudim)
     86  CALL handle_err(status)
    8487  status=NF_DEF_DIM(ncid_out,'lonv',iim+1,out_lonvdim)
     88  CALL handle_err(status)
    8589  status=NF_DEF_DIM(ncid_out,'latu',jjm+1,out_latudim)
     90  CALL handle_err(status)
    8691  status=NF_DEF_DIM(ncid_out,'latv',jjm,out_latvdim)
     92  CALL handle_err(status)
    8793
    8894
     
    136142
    137143  status=NF_ENDDEF(ncid_out)
     144  write(*,*) "COUCOU 6"
     145  CALL handle_err(status)
    138146  ! 5) ----- FERMETURE DES FICHIERS NETCDF------------------
    139147  ! --------------------------------------------------------
     
    143151#ifdef NC_DOUBLE
    144152  status=NF_PUT_VARA_DOUBLE(ncid_out,out_lonuid,1,iim+1,rlonudeg)
     153  CALL handle_err(status)
    145154  status=NF_PUT_VARA_DOUBLE(ncid_out,out_lonvid,1,iim+1,rlonvdeg)
     155  CALL handle_err(status)
    146156  status=NF_PUT_VARA_DOUBLE(ncid_out,out_latuid,1,jjm+1,rlatudeg)
     157  CALL handle_err(status)
    147158  status=NF_PUT_VARA_DOUBLE(ncid_out,out_latvid,1,jjm,rlatvdeg)
     159  CALL handle_err(status)
    148160#else
    149161  status=NF_PUT_VARA_REAL(ncid_out,out_lonuid,1,iim+1,rlonudeg)
     162  CALL handle_err(status)
    150163  status=NF_PUT_VARA_REAL(ncid_out,out_lonvid,1,iim+1,rlonvdeg)
     164  CALL handle_err(status)
    151165  status=NF_PUT_VARA_REAL(ncid_out,out_latuid,1,jjm+1,rlatudeg)
     166  CALL handle_err(status)
    152167  status=NF_PUT_VARA_REAL(ncid_out,out_latvid,1,jjm,rlatvdeg)
     168  CALL handle_err(status)
    153169#endif
    154170
     
    171187#ifdef NC_DOUBLE
    172188  status=NF_PUT_VARA_DOUBLE(ncid_out,out_varid,start, count,temp)
     189  CALL handle_err(status)
    173190#else
    174191  status=NF_PUT_VARA_REAL(ncid_out,out_varid,start, count,temp)
     192  CALL handle_err(status)
    175193#endif
    176194
    177195  ! On re-ouvre le fichier pour rajouter 4 nouvelles variables necessaire pour INCA
    178196! lev - phis - aire - mask
    179   rlevdeg(:) = presnivs
     197! rlevdeg(:) = presnivs
     198  rlevdeg(:) = presnivs(:)
    180199  phis_loc(:,:) = phis(:,:)/g
    181200
    182201! niveaux de pression verticaux
    183202  status = NF_REDEF (ncid_out)
     203  CALL handle_err(status)
    184204  status=NF_DEF_DIM(ncid_out,'lev',llm,out_levdim)
     205  CALL handle_err(status)
     206  status=NF_DEF_VAR(ncid_out,'presnivs',NF_FLOAT,1,out_levdim,&
     207                    presnivs_id)
     208  CALL handle_err(status)
    185209 
    186210! fields
     
    196220
    197221  status=NF_ENDDEF(ncid_out)
     222  CALL handle_err(status)
    198223
    199224  ! ecriture des variables
    200225#ifdef NC_DOUBLE
    201   status=NF_PUT_VARA_DOUBLE(ncid_out,out_levid,1,llm,rlevdeg)
     226  status=NF_PUT_VARA_DOUBLE(ncid_out,presnivs_id,1,llm,rlevdeg)
     227  CALL handle_err(status)
    202228#else
    203229  status=NF_PUT_VARA_REAL(ncid_out,out_levid,1,llm,rlevdeg)
     230  CALL handle_err(status)
    204231#endif
    205232
     
    214241
    215242  status = nf_put_vara_double(ncid_out, phis_id,start,count, phis_loc)
     243  CALL handle_err(status)
    216244  status = nf_put_vara_double(ncid_out, area_id,start,count, aire)
     245  CALL handle_err(status)
    217246  masque_int(:,:) = nINT(masque(:,:))
    218247  status = nf_put_vara_int(ncid_out, mask_id,start,count,masque_int)
  • LMDZ5/trunk/libf/dyn3dmem/ce0l.F90

    r1907 r1984  
    115115  END IF
    116116
    117   IF (grilles_gcm_netcdf) THEN
    118      WRITE(lunout,'(//)')
    119      WRITE(lunout,*) '  ***************************  '
    120      WRITE(lunout,*) '  ***  grilles_gcm_netcdf ***  '
    121      WRITE(lunout,*) '  ***************************  '
    122      WRITE(lunout,'(//)')
    123      CALL grilles_gcm_netcdf_sub(masque,phis)
    124   END IF
     117  WRITE(lunout,'(//)')
     118  WRITE(lunout,*) '  ***************************  '
     119  WRITE(lunout,*) '  ***  grilles_gcm_netcdf ***  '
     120  WRITE(lunout,*) '  ***************************  '
     121  WRITE(lunout,'(//)')
     122  CALL grilles_gcm_netcdf_sub(masque,phis)
    125123 
    126124#ifdef CPP_MPI
  • LMDZ5/trunk/libf/dyn3dmem/conf_gcm.F

    r1907 r1984  
    944944      ok_etat0 = .TRUE.
    945945      CALL getin('ok_etat0',ok_etat0)
    946 
    947 !Config  Key  = grilles_gcm_netcdf
    948 !Config  Desc = creation de fichier grilles_gcm.nc dans create_etat0_limit
    949 !Config  Def  = n
    950       grilles_gcm_netcdf = .FALSE.
    951       CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf)
    952946
    953947      write(lunout,*)' #########################################'
     
    999993      write(lunout,*)' ok_limit = ', ok_limit
    1000994      write(lunout,*)' ok_etat0 = ', ok_etat0
    1001       write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf
    1002995c
    1003996      RETURN
  • LMDZ5/trunk/libf/dyn3dmem/logic.h

    r1907 r1984  
    11!
    2 ! $Id$
     2! $Id: $
    33!
    44!
     
    1111     &  statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus       &
    1212     &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    13      &  ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid
     13     &  ,ok_limit,ok_etat0,hybrid
    1414
    1515      COMMON/logici/ iflag_phys,iflag_trac
     
    1818     & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus                      &
    1919     &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    20      &  ,ok_limit,ok_etat0,grilles_gcm_netcdf
     20     &  ,ok_limit,ok_etat0
     21     
    2122      logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
    2223                     ! (only used if disvert_type==2)
  • LMDZ5/trunk/libf/dyn3dpar/ce0l.F90

    r1907 r1984  
    115115  END IF
    116116
    117   IF (grilles_gcm_netcdf) THEN
    118      WRITE(lunout,'(//)')
    119      WRITE(lunout,*) '  ***************************  '
    120      WRITE(lunout,*) '  ***  grilles_gcm_netcdf ***  '
    121      WRITE(lunout,*) '  ***************************  '
    122      WRITE(lunout,'(//)')
    123      CALL grilles_gcm_netcdf_sub(masque,phis)
    124   END IF
     117  WRITE(lunout,'(//)')
     118  WRITE(lunout,*) '  ***************************  '
     119  WRITE(lunout,*) '  ***  grilles_gcm_netcdf ***  '
     120  WRITE(lunout,*) '  ***************************  '
     121  WRITE(lunout,'(//)')
     122  CALL grilles_gcm_netcdf_sub(masque,phis)
    125123 
    126124#ifdef CPP_MPI
  • LMDZ5/trunk/libf/dyn3dpar/conf_gcm.F

    r1907 r1984  
    942942      ok_etat0 = .TRUE.
    943943      CALL getin('ok_etat0',ok_etat0)
    944 
    945 !Config  Key  = grilles_gcm_netcdf
    946 !Config  Desc = creation de fichier grilles_gcm.nc dans create_etat0_limit
    947 !Config  Def  = n
    948       grilles_gcm_netcdf = .FALSE.
    949       CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf)
    950944
    951945      write(lunout,*)' #########################################'
     
    997991      write(lunout,*)' ok_limit = ', ok_limit
    998992      write(lunout,*)' ok_etat0 = ', ok_etat0
    999       write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf
    1000993c
    1001994      RETURN
  • LMDZ5/trunk/libf/dyn3dpar/logic.h

    r1907 r1984  
    1111     &  statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus       &
    1212     &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    13      &  ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid
     13     &  ,ok_limit,ok_etat0,hybrid
    1414
    1515      COMMON/logici/ iflag_phys,iflag_trac
     
    1818     & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus                      &
    1919     &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    20      &  ,ok_limit,ok_etat0,grilles_gcm_netcdf
     20     &  ,ok_limit,ok_etat0
     21
    2122      logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
    2223                     ! (only used if disvert_type==2)
Note: See TracChangeset for help on using the changeset viewer.