Changeset 1478


Ignore:
Timestamp:
Sep 30, 2015, 11:32:28 PM (9 years ago)
Author:
bclmd
Message:

bug for dimensions of tslab in start2archive

Location:
trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/ini_archive.F

    r1422 r1478  
    3636
    3737      USE comsoil_h
     38      USE slab_ice_h, only: noceanmx
    3839!      use control_mod
    3940      USE comvert_mod, ONLY: ap,bp,aps,bps,presnivs,pseudoalt
     
    8081      INTEGER idim_tim
    8182      INTEGER idim_nsoilmx ! "subsurface_layers" dimension ID #
     83      INTEGER idim_noceanmx ! "ocean_layers" dimension ID #
    8284      INTEGER nid,nvarid
    8385      real sig_s(llm),s(llm)
     
    162164      ierr = NF_DEF_DIM (nid, "altitude", llm, idim_llm)
    163165      ierr = NF_DEF_DIM (nid,"subsurface_layers",nsoilmx,idim_nsoilmx)
     166      ierr = NF_DEF_DIM (nid,"ocean_layers",noceanmx,idim_noceanmx)
    164167
    165168      ierr = NF_DEF_DIM (nid,"index", length, idim_index)
  • trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/lect_start_archive.F

    r1422 r1478  
    12941294      call interp_horiz (tslabold,tslabs,imold,jmold,iim,jjm,noceanmx,
    12951295     &                   rlonuold,rlatvold,rlonu,rlatv)
    1296       call gr_dyn_fi (1,iim+1,jjm+1,ngrid,tslabs,tslab)
     1296      call gr_dyn_fi (noceanmx,iim+1,jjm+1,ngrid,tslabs,tslab)
    12971297
    12981298      call interp_horiz (rnatold,rnats,imold,jmold,iim,jjm,1,
  • trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/start2archive.F

    r1422 r1478  
    508508     &        ,'sea_ice','',2,sea_iceS)
    509509      call write_archive(nid,ntime,'tslab'
    510      &        ,'tslab','',3,tslabS)
     510     &        ,'tslab','',-2,tslabS)
    511511      call write_archive(nid,ntime,'tsea_ice'
    512512     &        ,'tsea_ice','',2,tsea_iceS)
  • trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/write_archive.F

    r1422 r1478  
    3333
    3434      use comsoil_h, only: nsoilmx
     35      use slab_ice_h, only: noceanmx
     36
    3537      implicit none
    3638
     
    159161#endif
    160162
     163! For a 3D ocean temperature Variable
     164!-------------------------------
     165
     166        else if (dim.eq.-2) then
     167        ! get variables' ID, if it exists
     168        ierr=NF_INQ_VARID(nid,nom,varid)
     169
     170         if (ierr.ne.NF_NOERR) then ! variable not defined yet
     171          ! build related coordinates
     172          ierr=NF_INQ_DIMID(nid,"longitude",id(1))
     173          ierr=NF_INQ_DIMID(nid,"latitude",id(2))
     174          ierr=NF_INQ_DIMID(nid,"ocean_layers",id(3))
     175          if (ierr.ne.NF_NOERR) then
     176           write(*,*)"write_archive: dimension <ocean_layers>",
     177     &               " is missing !!!"
     178           call abort
     179          endif
     180          ierr=NF_INQ_DIMID(nid,"Time",id(4))
     181
     182          ! define the variable
     183          write(*,*)"====================="
     184          write(*,*)"defining ",nom
     185          call def_var(nid,nom,titre,unite,4,id,varid,ierr)
     186
     187         endif
     188
     189        ! build cedges and corners
     190        corner(1)=1
     191        corner(2)=1
     192        corner(3)=1
     193        corner(4)=ntime
     194
     195        edges(1)=iip1
     196        edges(2)=jjp1
     197        edges(3)=noceanmx
     198        edges(4)=1
     199#ifdef NC_DOUBLE
     200           ierr= NF_PUT_VARA_DOUBLE(nid,varid,corner,edges,px)
     201#else
     202           ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,px)
     203#endif
     204
     205
    161206
    162207! For a surface 2D Variable
Note: See TracChangeset for help on using the changeset viewer.