Changeset 3069


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

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90

    r3050 r3069  
    7979close(73)
    8080if (last_ilask == 0 .or. last_ilask == size(yearlask,1) + 1) then
    81     write(*,*) 'The current year could not be found in the file "obl_ecc_lsp.asc".'
    82     stop
     81    error stop 'The current year could not be found in the file "obl_ecc_lsp.asc".'
    8382else
    8483    write(*,*) 'The current year in the "obl_ecc_lsp.asc" file is at line:', last_ilask
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3068 r3069  
    11191119    write(*,*) "restart_evol.nc has been written"
    11201120#else
    1121     call writerestart1D('restart1D_evol.txt',ps(1),tsurf,nlayer,teta,ucov,vcov,nq,noms,qsurf,q)
     1121    call writerestart1D('restart1D_evol.txt',ps(1),tsurf(1,:),nlayer,size(tsurf,2),teta,ucov,vcov,nq,noms,qsurf(1,:,:),q)
    11221122    write(*,*) "restart1D_evol.txt has been written"
    11231123#endif
  • trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90

    r3047 r3069  
    102102enddo
    103103
    104 if (.not. found_year) then
    105     write(*,*) 'The new year could not be found in the file "obl_ecc_lsp.asc".'
    106     stop
    107 endif
     104if (.not. found_year) error stop 'The new year could not be found in the file "obl_ecc_lsp.asc".'
    108105
    109106halfaxe = 227.94
  • trunk/LMDZ.MARS/changelog.txt

    r3067 r3069  
    42334233== 03/10/2023 == JBC
    42344234In 1D, 'q' has been converted from dimension (:,:) to (1,:,:) and 'q2' is now got through the module 'turb_mod'. It allows more generalization and to match dimension in the subroutines.
     4235Related to commit r3066, correction of a bug to write/read a restart/start in 1D and more adaptations of the code.
  • 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
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90

    r3067 r3069  
    225225
    226226! Writing the "restart1D.txt" file for the next run
    227 if (startfiles_1D) call writerestart1D('restart1D.txt',psurf,tsurf(:,1),nlayer,temp,u,v,nq,noms,qsurf(1,:,1),q)
     227if (startfiles_1D) call writerestart1D('restart1D.txt',psurf,tsurf(1,:),nlayer,size(tsurf,2),temp,u,v,nq,noms,qsurf(1,:,:),q)
    228228
    229229write(*,*) "testphys1d: everything is cool."
     
    243243real, dimension(ngrid,nfield) :: pfi
    244244
    245 if (ngrid /= 1) then
    246     write(*,*) "gr_fi_dyn error: in 1D ngrid should be 1!!!"
    247     stop
    248 endif
     245if (ngrid /= 1) error stop 'gr_fi_dyn error: in 1D ngrid should be 1!!!'
    249246
    250247pdyn(1,1,1:nfield) = pfi(1,1:nfield)
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/writerestart1D.F90

    r3065 r3069  
    1 SUBROUTINE writerestart1D(filename,psurf,tsurf,nlayer,temp,u,v,nq,qnames,qsurf,q)
     1SUBROUTINE writerestart1D(filename,psurf,tsurf,nlayer,nslope,temp,u,v,nq,qnames,qsurf,q)
    22
    33implicit none
     
    55! Arguments
    66character(len = *),                intent(in) :: filename
    7 integer,                           intent(in) :: nlayer, nq
    8 real,                              intent(in) :: psurf, tsurf
     7integer,                           intent(in) :: nlayer, nq, nslope
     8real,                              intent(in) :: psurf
     9real, dimension(nslope),           intent(in) :: tsurf
    910real, dimension(nlayer),           intent(in) :: temp, u, v
    1011real, dimension(nlayer,nq),        intent(in) :: q
    11 real, dimension(nq),               intent(in) :: qsurf
     12real, dimension(nq,nslope),        intent(in) :: qsurf
    1213character(len = *), dimension(nq), intent(in) :: qnames
    1314
    1415! Local variables
    15 integer :: il, iq
     16integer :: i, j, il
    1617
    1718! Write the data needed for a restart in "restart1D.txt"
    1819open(1,file = filename,status = "replace",action = "write")
    19 do iq = 1,nq
    20     write(1,*) qnames(iq), qsurf(iq), (q(il,iq), il = 1,nlayer)
     20write(1,*) 'ps', psurf
     21do i = 1,nq
     22    write(1,*) qnames(i), (qsurf(i,j), j = 1,nslope), (q(il,i), il = 1,nlayer)
    2123enddo
    22 write(1,*) 'ps', psurf
    2324write(1,*) 'u', (u(il), il = 1,nlayer)
    2425write(1,*) 'v', (v(il), il = 1,nlayer)
    25 write(1,*) 'teta', tsurf, (temp(il), il = 1,nlayer)
     26write(1,*) 'teta', (tsurf(j), j = 1,nslope), (temp(il), il = 1,nlayer)
    2627close(1)
    2728
Note: See TracChangeset for help on using the changeset viewer.