Ignore:
Timestamp:
Oct 3, 2023, 3:54:57 PM (15 months ago)
Author:
jbclement
Message:

Mars PCM:
Related to commit r3066, correction of a bug to write/read a restart/start in 1D and more adaptations of the code.
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90

    r3067 r3069  
    7878! Local variables
    7979!=======================================================================
    80 integer                   :: ierr, iq, ilayer, isoil, nlevel, nsoil, flagthermo, flagh2o
     80integer                   :: ierr, iq, j, ilayer, isoil, nlevel, nsoil, flagthermo, flagh2o
    8181integer                   :: dayn ! Final date
    8282real, dimension(nlayer)   :: zlay ! altitude estimee dans les couches (km)
     
    131131        write(*,*) '  (which should contain some input parameters along with the following line: INCLUDEDEF=callphys.def)'
    132132        write(*,*) ' ... might as well stop here ...'
    133         stop
     133        error stop
    134134    endif
    135135
     
    151151        write(*,*) 'Initialization is done with default values.'
    152152    else
    153         write(*,*) 'Initialization cannot be done for the 1D PEM.'
    154         stop
     153        error stop 'Initialization cannot be done for the 1D PEM.'
    155154    endif
    156155endif
     
    161160        write(*,*) 'Initialization is done with default values.'
    162161    else
    163         write(*,*) 'Initialization cannot be done for the 1D PEM.'
    164         stop
     162        error stop 'Initialization cannot be done for the 1D PEM.'
    165163    endif
    166164endif
     
    218216    write(*,*) ' If you want to run with tracers, I need it'
    219217    write(*,*) ' ... might as well stop here ...'
    220     stop
     218    error stop
    221219else
    222220    write(*,*) "init_testphys1d: Reading file traceur.def"
     
    227225        write(*,*) "init_testphys1d: error reading number of tracers"
    228226        write(*,*) "   (first line of traceur.def) "
    229         stop
     227        error stop
    230228    endif
    231229    if (nq < 1) then
    232230        write(*,*) "init_testphys1d: error number of tracers"
    233231        write(*,*) "is nq=",nq," but must be >=1!"
    234         stop
     232        error stop
    235233    endif
    236234endif
     
    244242    read(90,'(80a)',iostat = ierr) line ! store the line from traceur.def
    245243    if (ierr /= 0) then
    246         write(*,*) 'init_testphys1d: error reading tracer names...'
    247         stop
     244        error stop 'init_testphys1d: error reading tracer names...'
    248245    endif
    249246    ! if format is tnom_0, tnom_transp (isotopes)
     
    353350    call getin("psurf",psurf)
    354351else
     352    open(3,file = start1Dname,status = "old",action = "read")
    355353    read(3,*) header, psurf
    356354endif
     
    452450else
    453451    do iq = 1,nq
    454         open(3,file = start1Dname,status = "old",action = "read")
    455         read(3,*) header, qsurf(1,iq,1),(q(1,ilayer,iq), ilayer = 1,nlayer)
    456         if (trim(tname(iq)) /= trim(header)) then
    457             write(*,*) 'Tracer names not compatible for initialization with "'//trim(start1Dname)//'"!'
    458             stop
    459         endif
     452        read(3,*) header, (qsurf(1,iq,j), j = 1,size(qsurf,3)), (q(1,ilayer,iq), ilayer = 1,nlayer)
     453        if (trim(tname(iq)) /= trim(header)) error stop 'Tracer names not compatible for initialization with "'//trim(start1Dname)//'"!'
    460454    enddo
    461455endif
    462 
    463 
    464456
    465457! Initialize albedo / soil thermal inertia
     
    562554    if (trim(tname(iq)) == "co2") igcm_co2 = iq
    563555enddo
    564 if (igcm_co2 == 0) then
    565     write(*,*) "init_testphys1d error, missing co2 tracer!"
    566     stop
    567 endif
     556if (igcm_co2 == 0) error stop "init_testphys1d error, missing co2 tracer!"
    568557
    569558if (.not. startfiles_1D) then
     
    615604    temp(:) = tmp2(1:)
    616605else
    617     read(3,*) header, tsurf, (temp(ilayer), ilayer = 1,nlayer)
     606    read(3,*) header, (tsurf(1,:), j = 1,size(tsurf,2)), (temp(ilayer), ilayer = 1,nlayer)
    618607    close(3)
    619608endif
     
    719708        write(*,*) 'Unless it reaches saturation (maximal value)'
    720709    else
    721         write(*,*) 'Water vapor profile value not correct!'
    722         stop
     710        error stop 'Water vapor profile value not correct!'
    723711    endif
    724712endif
     
    740728        else
    741729            write(*,*) 'Reference atmospheric water vapor profile not known!'
    742             write(*,*) 'Please, specify atm_wat_profile'
    743             stop
     730            error stop 'Please, specify atm_wat_profile'
    744731        endif
    745732    endif
Note: See TracChangeset for help on using the changeset viewer.