Changeset 146


Ignore:
Timestamp:
Jun 8, 2011, 12:04:26 PM (13 years ago)
Author:
emillour
Message:

Mars GCM:

minor bug fix in lect_start_archive.F (using wrong surface temp. array).

+ swiched output messages to english and added that tracers not found
in file must be initialized by user.

minor bug fix in datareadnc.F : 'datafile' path must be initialized.

EM

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r141 r146  
    649649>> minor bug correction in writeg1d (JYC)
    650650>> add "-check" to debug option in makegcm_ifort
     651
     652== 08/06/2011 == EM
     653>> minor bug fix in lect_start_archive.F (using wrong surface temp. array).
     654   + swiched output messages to english and added that tracers not found
     655   in file must be initialized by user.
     656>> minor bug fix in datareadnc.F : 'datafile' path must be initialized.
  • trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F

    r38 r146  
    185185      integer :: counter
    186186      character(len=30) :: txt ! to store some text
     187      real :: tmpval ! to store a temporary variable/value
    187188
    188189c=======================================================================
     
    350351      ierr = NF_INQ_VARID (nid, "controle", nvarid)
    351352      IF (ierr .NE. NF_NOERR) THEN
    352          PRINT*, "Lect_start_archive: champ <controle> est absent"
     353         PRINT*, "Lect_start_archive: <controle> is missing"
    353354         CALL abort
    354355      ENDIF
     
    359360#endif
    360361      IF (ierr .NE. NF_NOERR) THEN
    361          PRINT*, "lect_start_archive: Lecture echoue pour <controle>"
     362         PRINT*, "lect_start_archive: Failed loading <controle>"
    362363         CALL abort
    363364      ENDIF
     
    371372      ierr = NF_INQ_VARID (nid, "rlonv", nvarid)
    372373      IF (ierr .NE. NF_NOERR) THEN
    373          PRINT*, "lect_start_archive: Le champ <rlonv> est absent"
     374         PRINT*, "lect_start_archive: <rlonv> is missing"
    374375         CALL abort
    375376      ENDIF
     
    380381#endif
    381382      IF (ierr .NE. NF_NOERR) THEN
    382          PRINT*, "lect_start_archive: Lecture echouee pour <rlonv>"
     383         PRINT*, "lect_start_archive: Failed loading <rlonv>"
    383384         CALL abort
    384385      ENDIF
     
    386387      ierr = NF_INQ_VARID (nid, "rlatu", nvarid)
    387388      IF (ierr .NE. NF_NOERR) THEN
    388          PRINT*, "lect_start_archive: Le champ <rlatu> est absent"
     389         PRINT*, "lect_start_archive: <rlatu> is missing"
    389390         CALL abort
    390391      ENDIF
     
    395396#endif
    396397      IF (ierr .NE. NF_NOERR) THEN
    397          PRINT*, "lect_start_archive: Lecture echouee pour <rlatu>"
     398         PRINT*, "lect_start_archive: Failed loading <rlatu>"
    398399         CALL abort
    399400      ENDIF
     
    401402      ierr = NF_INQ_VARID (nid, "rlonu", nvarid)
    402403      IF (ierr .NE. NF_NOERR) THEN
    403          PRINT*, "lect_start_archive: Le champ <rlonu> est absent"
     404         PRINT*, "lect_start_archive: <rlonu> is missing"
    404405         CALL abort
    405406      ENDIF
     
    410411#endif
    411412      IF (ierr .NE. NF_NOERR) THEN
    412          PRINT*, "lect_start_archive: Lecture echouee pour <rlonu>"
     413         PRINT*, "lect_start_archive: Failed loading <rlonu>"
    413414         CALL abort
    414415      ENDIF
     
    416417      ierr = NF_INQ_VARID (nid, "rlatv", nvarid)
    417418      IF (ierr .NE. NF_NOERR) THEN
    418          PRINT*, "lect_start_archive: Le champ <rlatv> est absent"
     419         PRINT*, "lect_start_archive: <rlatv> is missing"
    419420         CALL abort
    420421      ENDIF
     
    425426#endif
    426427      IF (ierr .NE. NF_NOERR) THEN
    427          PRINT*, "lect_start_archive: Lecture echouee pour <rlatv>"
     428         PRINT*, "lect_start_archive: Failed loading <rlatv>"
    428429         CALL abort
    429430      ENDIF
     
    436437      ierr = NF_INQ_VARID (nid, "aps", nvarid)
    437438      IF (ierr .NE. NF_NOERR) THEN
    438          PRINT*, "lect_start_archive: Le champ <aps> est absent"
     439         PRINT*, "lect_start_archive: <aps> is missing"
    439440         apsold=0
    440441         PRINT*, "<aps> set to 0"
     
    446447#endif
    447448         IF (ierr .NE. NF_NOERR) THEN
    448             PRINT*, "lect_start_archive: Lecture echouee pour <aps>"
     449            PRINT*, "lect_start_archive: Failed loading <aps>"
    449450         ENDIF
    450451      ENDIF
     
    452453      ierr = NF_INQ_VARID (nid, "bps", nvarid)
    453454      IF (ierr .NE. NF_NOERR) THEN
    454          PRINT*, "lect_start_archive: Le champ <bps> est absent"
     455         PRINT*, "lect_start_archive: <bps> is missing"
    455456         PRINT*, "It must be an old start_archive, lets look for sig_s"
    456457         ierr = NF_INQ_VARID (nid, "sig_s", nvarid)
     
    466467#endif
    467468      IF (ierr .NE. NF_NOERR) THEN
    468          PRINT*, "lect_start_archive: Lecture echouee pour <bps>"
     469         PRINT*, "lect_start_archive: Failed loading <bps>"
    469470         CALL abort
    470471      END IF
     
    555556      ierr = NF_INQ_VARID (nid, "phisinit", nvarid)
    556557      IF (ierr .NE. NF_NOERR) THEN
    557          PRINT*, "lect_start_archive: Le champ <phisinit> est absent"
     558         PRINT*, "lect_start_archive: <phisinit> is missing"
    558559         CALL abort
    559560      ENDIF
     
    564565#endif
    565566      IF (ierr .NE. NF_NOERR) THEN
    566          PRINT*, "lect_start_archive: Lecture echouee pour <phisinit>"
     567         PRINT*, "lect_start_archive: Failed loading <phisinit>"
    567568         CALL abort
    568569      ENDIF
     
    584585         ierr = NF_INQ_DIMID (nid, "temps", nvarid)
    585586         IF (ierr .NE. NF_NOERR) THEN
    586             PRINT*, "lect_start_archive: Le champ <Time> est absent"
     587            PRINT*, "lect_start_archive: <Time> is missing"
    587588            CALL abort
    588589         endif
     
    599600#endif
    600601      IF (ierr .NE. NF_NOERR) THEN
    601          PRINT*, "lect_start_archive: Lecture echouee pour <Time>"
     602         PRINT*, "lect_start_archive: Failed loading <Time>"
    602603         CALL abort
    603604      ENDIF
     
    605606      write(*,*)
    606607      write(*,*)
    607       write(*,*) 'Differentes dates des etats initiaux stockes:'
    608       write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
     608      write(*,*) 'Dates of the stored initial states:'
     609      write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
    609610      pi=2.*ASIN(1.)
    610611      do i=1,timelen
    611612c       call solarlong(timelist(i),sollong(i))
    612613c       sollong(i) = sollong(i)*180./pi
    613         write(*,*) 'etat initial au jour martien' ,int(timelist(i))
     614        write(*,*) 'initial state at martian day: ',int(timelist(i))
    614615c       write(*,6) nint(timelist(i)),nint(mod(timelist(i),669)),
    615616c    .    sollong(i)
     
    619620 
    620621      write(*,*)
    621       write(*,*) 'Choix de la date'
     622      write(*,*) 'Choose the martian day to use'
    622623 123  read(*,*,iostat=ierr) date
    623624      if(ierr.ne.0) goto 123
     
    632633        write(*,*)
    633634        write(*,*)
    634         write(*,*) 'He alors... Y sait pas lire !?!'
     635        write(*,*) 'Wrong value for day number !!'
    635636        write(*,*)
    636         write(*,*) 'Differentes dates des etats initiaux stockes:'
    637         write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
     637        write(*,*) 'Dates of the stored initial states:'
     638        write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
    638639        do i=1,timelen
    639           write(*,*) 'etat initial au jour martien' ,nint(timelist(i))
     640          write(*,*) 'initial state at martian day: ',nint(timelist(i))
    640641c         write(*,6) nint(timelist(i)),nint(mod(timelist(i),669))
    641642        end do
     
    657658      ierr = NF_INQ_VARID (nid, "co2ice", nvarid)
    658659      IF (ierr .NE. NF_NOERR) THEN
    659          PRINT*, "lect_start_archive: Le champ <co2ice> est absent"
     660         PRINT*, "lect_start_archive: <co2ice> is missing"
    660661         CALL abort
    661662      ENDIF
     
    666667#endif
    667668      IF (ierr .NE. NF_NOERR) THEN
    668          PRINT*, "lect_start_archive: Lecture echouee pour <co2ice>"
     669         PRINT*, "lect_start_archive: Failed loading <co2ice>"
    669670         PRINT*, NF_STRERROR(ierr)
    670671         CALL abort
     
    673674      ierr = NF_INQ_VARID (nid, "emis", nvarid)
    674675      IF (ierr .NE. NF_NOERR) THEN
    675          PRINT*, "lect_start_archive: Le champ <emis> est absent"
     676         PRINT*, "lect_start_archive: <emis> is missing"
    676677         CALL abort
    677678      ENDIF
     
    682683#endif
    683684      IF (ierr .NE. NF_NOERR) THEN
    684          PRINT*, "lect_start_archive: Lecture echouee pour <emis>"
     685         PRINT*, "lect_start_archive: Failed loading <emis>"
    685686         CALL abort
    686687      ENDIF
     
    688689      ierr = NF_INQ_VARID (nid, "ps", nvarid)
    689690      IF (ierr .NE. NF_NOERR) THEN
    690          PRINT*, "lect_start_archive: Le champ <ps> est absent"
     691         PRINT*, "lect_start_archive: <ps> is missing"
    691692         CALL abort
    692693      ENDIF
     
    697698#endif
    698699      IF (ierr .NE. NF_NOERR) THEN
    699          PRINT*, "lect_start_archive: Lecture echouee pour <ps>"
     700         PRINT*, "lect_start_archive: Failed loading <ps>"
    700701         CALL abort
    701702      ENDIF
     
    703704      ierr = NF_INQ_VARID (nid, "tsurf", nvarid)
    704705      IF (ierr .NE. NF_NOERR) THEN
    705          PRINT*, "lect_start_archive: Le champ <tsurf> est absent"
     706         PRINT*, "lect_start_archive: <tsurf> is missing"
    706707         CALL abort
    707708      ENDIF
     
    712713#endif
    713714      IF (ierr .NE. NF_NOERR) THEN
    714          PRINT*, "lect_start_archive: Lecture echouee pour <tsurf>"
     715         PRINT*, "lect_start_archive: Failed loading <tsurf>"
    715716         CALL abort
    716717      ENDIF
     
    718719      ierr = NF_INQ_VARID (nid, "q2surf", nvarid)
    719720      IF (ierr .NE. NF_NOERR) THEN
    720          PRINT*, "lect_start_archive: Le champ <q2surf> est absent"
     721         PRINT*, "lect_start_archive: <q2surf> is missing"
    721722         CALL abort
    722723      ENDIF
     
    727728#endif
    728729      IF (ierr .NE. NF_NOERR) THEN
    729          PRINT*, "lect_start_archive: Lecture echouee pour <q2surf>"
     730         PRINT*, "lect_start_archive: Failed loading <q2surf>"
    730731         CALL abort
    731732      ENDIF
     
    740741c -------------------------------------------
    741742! Surface tracers:     
    742       do iq=1,nqmx
    743         call initial0((jmold+1)*(imold+1), qsurfold(1,1,iq))
    744       enddo
     743      qsurfold(1:imold+1,1:jmold+1,1:nqmx)=0
    745744
    746745      DO iq=1,nqmx
    747 !      iq=nqold
    748 !        write(str2,'(i2.2)') iq
    749746        IF (oldtracernames) THEN
    750747          txt=" "
     
    765762          PRINT*, "lect_start_archive: ",
    766763     &              " Tracer <",trim(txt),"> not found"
    767           CALL abort
     764          print*, "which (constant) value should it be initialized to?"
     765          read(*,*) tmpval
     766          qsurfold(1:imold+1,1:jmold+1,iq)=tmpval
    768767        ENDIF
    769768#ifdef NC_DOUBLE
     
    777776          PRINT*, "lect_start_archive: ",
    778777     &             " Failed loading <",trim(txt),">"
    779           write (*,*) trim(txt),'     set to 0'
    780           call initial0((jmold+1)*(imold+1), qsurfold(1,1,iq))
     778          print*, "which (constant) value should it be initialized to?"
     779          read(*,*) tmpval
     780          qsurfold(1:imold+1,1:jmold+1,iq)=tmpval
    781781        ENDIF
    782782
    783783      ENDDO ! of DO iq=1,nqmx
    784 
    785 ! The trick below is to read in tracer nqmx-1 (i.e. water ice)
    786 !      if ((nqold.gt.1).and.(nqmx.gt.1)) then
    787 !        iq=nqold-1
    788 !        write(str2,'(i2.2)') iq
    789 !         ierr = NF_INQ_VARID (nid, "qsurf"//str2, nvarid)
    790 !         IF (ierr .NE. NF_NOERR) THEN
    791 !            PRINT*, "lect_start_archive:
    792 !     .               Le champ <","qsurf"//str2,"> est absent"
    793 !            CALL abort
    794 !         ENDIF
    795 !#ifdef NC_DOUBLE
    796 !         ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,
    797 !     .          qsurfold(1,1,nqmx-1))
    798 !#else
    799 !         ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,
    800 !     .          qsurfold(1,1,nqmx-1))
    801 !#endif
    802 !         IF (ierr .NE. NF_NOERR) THEN
    803 !            PRINT*, "lect_start_archive:
    804 !     .               Lecture echouee pour <","qsurf"//str2,">"
    805 !            write (*,*) 'qsurf'//str2,' set to 0'
    806 !            call initial0((jmold+1)*(imold+1), qsurfold(1,1,nqmx-1))
    807 !         ENDIF
    808 !      endif
    809 
    810 ! The trick below is to read in tracers except nqmx & nqmx-1 (water vap.& ice)
    811 !      if (nqold.gt.2) then
    812 !       do  iq = 1, nqold-2
    813 !       if (iq.lt.nqmx-1) then
    814 !         write(str2,'(i2.2)') iq
    815 !         ierr = NF_INQ_VARID (nid, "qsurf"//str2, nvarid)
    816 !         IF (ierr .NE. NF_NOERR) THEN
    817 !            PRINT*, "lect_start_archive:
    818 !     .               Le champ <","qsurf"//str2,"> est absent"
    819 !            CALL abort
    820 !         ENDIF
    821 !#ifdef NC_DOUBLE
    822 !         ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,
    823 !     .          qsurfold(1,1,iq))
    824 !#else
    825 !         ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,
    826 !     .          qsurfold(1,1,iq))
    827 !#endif
    828 !         IF (ierr .NE. NF_NOERR) THEN
    829 !            PRINT*, "lect_start_archive:
    830 !     .               Lecture echouee pour <","qsurf"//str2,">"
    831 !            write (*,*) 'qsurf'//str2,' set to 0'
    832 !            call initial0((jmold+1)*(imold+1), qsurfold(1,1,iq))
    833 !         ENDIF
    834 !       end if
    835 !       end do
    836 !      end if
    837784
    838785!-----------------------------------------------------------------------
     
    920867      ierr = NF_INQ_VARID (nid,"temp", nvarid)
    921868      IF (ierr .NE. NF_NOERR) THEN
    922          PRINT*, "lect_start_archive: Le champ <temp> est absent"
     869         PRINT*, "lect_start_archive: <temp> is missing"
    923870         CALL abort
    924871      ENDIF
     
    929876#endif
    930877      IF (ierr .NE. NF_NOERR) THEN
    931          PRINT*, "lect_start_archive: Lecture echouee pour <temp>"
     878         PRINT*, "lect_start_archive: Failed loading <temp>"
    932879         CALL abort
    933880      ENDIF
     
    935882      ierr = NF_INQ_VARID (nid,"u", nvarid)
    936883      IF (ierr .NE. NF_NOERR) THEN
    937          PRINT*, "lect_start_archive: Le champ <u> est absent"
     884         PRINT*, "lect_start_archive: <u> is missing"
    938885         CALL abort
    939886      ENDIF
     
    944891#endif
    945892      IF (ierr .NE. NF_NOERR) THEN
    946          PRINT*, "lect_start_archive: Lecture echouee pour <u>"
     893         PRINT*, "lect_start_archive: Failed loading <u>"
    947894         CALL abort
    948895      ENDIF
     
    950897      ierr = NF_INQ_VARID (nid,"v", nvarid)
    951898      IF (ierr .NE. NF_NOERR) THEN
    952          PRINT*, "lect_start_archive: Le champ <v> est absent"
     899         PRINT*, "lect_start_archive: <v> is missing"
    953900         CALL abort
    954901      ENDIF
     
    959906#endif
    960907      IF (ierr .NE. NF_NOERR) THEN
    961          PRINT*, "lect_start_archive: Lecture echouee pour <v>"
     908         PRINT*, "lect_start_archive: Failed loading <v>"
    962909         CALL abort
    963910      ENDIF
     
    965912      ierr = NF_INQ_VARID (nid,"q2atm", nvarid)
    966913      IF (ierr .NE. NF_NOERR) THEN
    967          PRINT*, "lect_start_archive: Le champ <q2atm> est absent"
     914         PRINT*, "lect_start_archive: <q2atm> is missing"
    968915         CALL abort
    969916      ENDIF
     
    974921#endif
    975922      IF (ierr .NE. NF_NOERR) THEN
    976          PRINT*, "lect_start_archive: Lecture echouee pour <q2atm>"
     923         PRINT*, "lect_start_archive: Failed loading <q2atm>"
    977924         CALL abort
    978925      ENDIF
     
    982929c the others keep their rank. ! No longer true.
    983930c -------------------------------------------
    984 ! Tracers:     
    985       do iq=1,nqmx
    986          call initial0((jmold+1)*(imold+1)*lmold,qold(1,1,1,iq) )
    987       enddo
     931! Tracers:
     932      qold(1:imold+1,1:jmold+1,1:lmold,1:nqmx)=0
    988933
    989934      DO iq=1,nqmx
    990 !      iq=nqold
    991 !        write(str2,'(i2.2)') iq
    992935        IF (oldtracernames) THEN
    993936          txt=" "
     
    1001944            PRINT*, "lect_start_archive: ",
    1002945     &              " Tracer <",trim(txt),"> not found"
    1003             CALL abort
     946          print*, "which (constant) value should it be initialized to?"
     947          read(*,*) tmpval
     948          qold(1:imold+1,1:jmold+1,1:lmold,iq)=tmpval
    1004949        ENDIF
    1005950#ifdef NC_DOUBLE
     
    1011956          PRINT*, "lect_start_archive: ",
    1012957     &             "  Failed loading <",trim(txt),">"
    1013           write (*,*) trim(txt),'      set to 1.E-30'
    1014           do l=1,lmold
    1015             do j=1,jmold+1
    1016               do i=1,imold+1
    1017                  qold(i,j,l,iq)=1.e-30
    1018               end do
    1019             end do
    1020           end do
     958          print*, "which (constant) value should it be initialized to?"
     959          read(*,*) tmpval
     960          qold(1:imold+1,1:jmold+1,1:lmold,iq)=tmpval
    1021961        ENDIF
    1022962
    1023963      ENDDO ! of DO iq=1,nqmx
    1024964
    1025 ! The trick below is to read in tracer nqmx-1 (i.e. water ice)
    1026 !      if ((nqold.gt.1).and.(nqmx.gt.1)) then
    1027 !        iq=nqold-1
    1028 !        write(str2,'(i2.2)') iq
    1029 !         ierr = NF_INQ_VARID (nid, "q"//str2, nvarid)
    1030 !         IF (ierr .NE. NF_NOERR) THEN
    1031 !            PRINT*, "lect_start_archive:
    1032 !     .               Le champ <","q"//str2,"> est absent"
    1033 !            CALL abort
    1034 !         ENDIF
    1035 !#ifdef NC_DOUBLE
    1036 !         ierr= NF_GET_VARA_DOUBLE(nid,nvarid,start,count,
    1037 !     .                            qold(1,1,1,nqmx-1))
    1038 !#else
    1039 !         ierr= NF_GET_VARA_REAL(nid,nvarid,start,count,
    1040 !     .                            qold(1,1,1,nqmx-1))
    1041 !#endif
    1042 !         IF (ierr .NE. NF_NOERR) THEN
    1043 !            PRINT*, "lect_start_archive:
    1044 !     .               Lecture echouee pour <","q"//str2,">"
    1045 !            write (*,*) 'q'//str2,' set to 1.E-30'
    1046 !            do l=1,lmold
    1047 !              do j=1,jmold+1
    1048 !                do i=1,imold+1
    1049 !                   qold(1,1,1,nqmx-1)=1.e-30
    1050 !                end do
    1051 !              end do
    1052 !            end do
    1053 !
    1054 !         ENDIF
    1055 !      endif
    1056 
    1057 ! The trick below is to read in tracers except nqmx & nqmx-1 (water vap.& ice)
    1058 !      if (nqold.gt.2) then
    1059 !       do  iq = 1, nqold-2
    1060 !       if (iq.lt.nqmx-1) then
    1061 !         write(str2,'(i2.2)') iq
    1062 !         ierr = NF_INQ_VARID (nid, "q"//str2, nvarid)
    1063 !         IF (ierr .NE. NF_NOERR) THEN
    1064 !            PRINT*, "lect_start_archive:
    1065 !     .               Le champ <","q"//str2,"> est absent"
    1066 !            CALL abort
    1067 !         ENDIF
    1068 !#ifdef NC_DOUBLE
    1069 !         ierr= NF_GET_VARA_DOUBLE(nid,nvarid,start,count,qold(1,1,1,iq))
    1070 !#else
    1071 !         ierr= NF_GET_VARA_REAL(nid,nvarid,start,count,qold(1,1,1,iq))
    1072 !#endif
    1073 !         IF (ierr .NE. NF_NOERR) THEN
    1074 !            PRINT*, "lect_start_archive:
    1075 !     .               Lecture echouee pour <","q"//str2,">"
    1076 !            write (*,*) 'q'//str2,' set to 1.E-30 '
    1077 !            do l=1,lmold
    1078 !              do j=1,jmold+1
    1079 !                do i=1,imold+1
    1080 !                   qold(1,1,1,iq)=1.e-30
    1081 !                end do
    1082 !              end do
    1083 !            end do
    1084 
    1085 !         ENDIF
    1086 !       end if
    1087 !       end do
    1088 !      end if
    1089965
    1090966c Chemin pour trouver les donnees de surface (albedo, relief, th.inertia...)
     
    11571033
    11581034      write(*,*)
    1159       write(*,*)'Ancienne grille: masse de l atm :',ptotalold
    1160       write(*,*)'Nouvelle grille: masse de l atm :',ptotal
    1161       write (*,*) 'Ratio new atm./ old atm =', ptotal/ptotalold
     1035      write(*,*)'Old grid: mass of the atmosphere :',ptotalold
     1036      write(*,*)'New grid: mass of the atmosphere :',ptotal
     1037      write (*,*) 'Ratio new atm / old atm =', ptotal/ptotalold
    11621038      write(*,*)
    1163       write(*,*)'Ancienne grille: masse de la glace CO2:',co2icetotalold
    1164       write(*,*)'Nouvelle grille: masse de la glace CO2:',co2icetotal
    1165       write(*,*)'Ratio new ice./old ice =',co2icetotal/co2icetotalold
     1039      write(*,*)'Old grid: mass of CO2 ice:',co2icetotalold
     1040      write(*,*)'New grid: mass of CO2 ice:',co2icetotal
     1041      write(*,*)'Ratio new ice / old ice =',co2icetotal/co2icetotalold
    11661042      write(*,*)
    11671043
     
    12631139         do j=1,jmold+1
    12641140           ! copy values
    1265            oldval(1)=tsurfS(i,j)
     1141           oldval(1)=tsurfold(i,j)
    12661142           oldval(2:nsoilold+1)=tsoilold(i,j,1:nsoilold)
    12671143           ! build vertical coordinate
     
    12951171         do j=1,jmold+1
    12961172           ! copy values
    1297            oldval(1)=tsurfS(i,j)
     1173           oldval(1)=tsurfold(i,j)
    12981174           oldval(2:nsoilold+1)=tsoilold(i,j,1:nsoilold)
    12991175          ! interpolate
  • trunk/LMDZ.MARS/libf/phymars/datareadnc.F

    r38 r146  
    4141c                   (rlatvd de 89 a -89)
    4242c=======================================================================
     43
     44! to use  'getin'
     45       use ioipsl_getincom
    4346
    4447      implicit none
     
    7780      REAL        zthe(imdp1*jmdp1)
    7881
    79       INTEGER   lnblnk, ierr
    80       EXTERNAL    lnblnk
     82      INTEGER     ierr
    8183
    8284      INTEGER   unit,nvarid
     
    9597      DIMENSION string(4)
    9698
    97       CHARACTER*80    file
    9899
    99100#include "lmdstd.h"
     
    109110c    Lecture NetCDF des donnees latitude et longitude
    110111c-----------------------------------------------------------------------
    111       write(*,*) 'ouverture du fichier surface.nc'
    112 
    113       ierr = NF_OPEN (datafile(1:lnblnk(datafile))//'/surface.nc',
     112      write(*,*) 'datareadnc: opening file surface.nc'
     113
     114      datafile="/u/forget/WWW/datagcm/datafile" ! default path to surface.nc
     115      call getin("datadir",datafile) ! but users may specify another path
     116     
     117      ierr = NF_OPEN (trim(datafile)//'/surface.nc',
    114118     &  NF_NOWRITE,unit)
    115119      IF (ierr.NE.NF_NOERR) THEN
    116120        write(*,*)'Error : cannot open file surface.nc '
    117121        write(*,*)'(in phymars/datareadnc.F)'
    118         write(*,*)'It should be in :',datafile(1:lnblnk(datafile)),'/'
    119         write(*,*)'1) You can change this directory address in '
    120         write(*,*)'   file phymars/datafile.h'
     122        write(*,*)'It should be in :',trim(datafile),'/'
     123        write(*,*)'1) You can set this path in the callphys.def file:'
     124        write(*,*)'   datadir=/path/to/the/datafiles'
    121125        write(*,*)'2) If necessary surface.nc (and other datafiles)'
    122126        write(*,*)'   can be obtained online on:'
     
    176180      string(2) = 'thermal'
    177181      if (relief.ne.'pla') then
    178         write(*,*) ' La topographie est celle de MOLA'
     182        write(*,*) ' MOLA topography'
    179183        relief = 'MOL'
    180184          string(3) = 'z'//relief
     
    282286            phisinit(i)=1000.*phisinit(i)
    283287      ENDDO
    284       CALL dump2d(iimp1,jjp1,phisinit,'Altitude en m')
     288      CALL dump2d(iimp1,jjp1,phisinit,'Altitude in m')
    285289      CALL multscal(iimp1*jjp1,phisinit,g,phisinit)
    286290
Note: See TracChangeset for help on using the changeset viewer.