Ignore:
Timestamp:
Nov 25, 2013, 5:40:00 PM (11 years ago)
Author:
tnavarro
Message:

Using option all variables for concat was not working + Consistent controle field about the date in the concat file.

File:
1 edited

Legend:

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

    r1073 r1118  
    2727character (len=80), dimension(1000) :: file
    2828! file(): input file(s) names(s)
    29 character (len=30), dimension(15) :: notconcat
    30 ! notconcat(): names of the (15) variables that won't be concatenated
     29character (len=30), dimension(16) :: notconcat
     30! notconcat(): names of the (16) variables that won't be concatenated
    3131character (len=50), dimension(:), allocatable :: var
    3232! var(): name(s) of variable(s) that will be concatenated
     
    192192notconcat(14)='aire'
    193193notconcat(15)='phisinit'
     194notconcat(16)='soildepth'
     195
    194196
    195197!==============================================================================
     
    202204   ! vartmp now contains the "name" of variable of ID # i
    203205   var_ok=0
    204    do inter=1,15
     206   do inter=1,size(notconcat)
    205207      if (vartmp.eq.notconcat(inter)) then
    206208         var_ok=1
    207209         Nnotconcat=Nnotconcat+1
    208210      endif
    209    enddo        
     211   enddo     
    210212   if (var_ok.eq.0)  write(*,*) trim(vartmp)
    211213enddo
     
    249251! Variables names from the file are catched
    250252   nbvar=nbvarfile-Nnotconcat
    251    do i=1,nbvar
    252       ierr=nf_inq_varname(nid,i+Nnotconcat,var(i))
    253       write(*,'(a9,1x,i2,1x,a1,1x,a50)') "variable ",i,":",var(i)
     253   j=1
     254   do i=1,nbvarfile
     255      ierr=nf_inq_varname(nid,i,vartmp)
     256      var_ok=0
     257      do inter=1,size(notconcat)
     258        if (vartmp.eq.notconcat(inter)) then
     259           var_ok=1
     260        endif
     261      enddo
     262      if (var_ok.eq.0) then
     263         if (j .gt. nbvar) then
     264           write(*,*) "PROBLEM HERE !", var
     265           stop
     266         endif
     267         var(j) = vartmp
     268         write(*,'(a9,1x,i2,1x,a1,1x,a50)') "variable ",j,":",var(j)
     269         j=j+1
     270      endif
    254271   enddo
    255272else if(nbvar==0) then
     
    379396                                modulo(int(memotime),669)," but ",modulo(int(ctl(4)),669),"!!"
    380397           write(*,*) "Starting day of the run has been corrected."
    381            memotime=float(modulo(int(ctl(4)),669))
     398           memotime=float(modulo(int(ctl(4)),669)) + ctl(27)
     399           ctl(4) = 0.
     400           ctl(27) = 0.
    382401         endif
    383402      endif
     
    746765   ierr = NF_REDEF (nout)
    747766
    748    #ifdef NC_DOUBLE
     767#ifdef NC_DOUBLE
    749768   ierr = NF_DEF_VAR (nout,"controle",NF_DOUBLE,1,ctldimout,nvarid)
    750    #else
     769#else
    751770   ierr = NF_DEF_VAR (nout,"controle",NF_FLOAT,1,ctldimout,nvarid)
    752    #endif
     771#endif
    753772
    754773   ierr = NF_PUT_ATT_TEXT (nout,nvarid,"title",18,"Control parameters")
     
    757776   ierr = NF_ENDDEF(nout)
    758777
    759    #ifdef NC_DOUBLE
     778#ifdef NC_DOUBLE
    760779   ierr = NF_PUT_VAR_DOUBLE (nout,nvarid,ctl)
    761    #else
     780#else
    762781   ierr = NF_PUT_VAR_REAL (nout,nvarid,ctl)
    763    #endif
     782#endif
    764783endif
    765784
Note: See TracChangeset for help on using the changeset viewer.