Changeset 3801


Ignore:
Timestamp:
Jun 6, 2025, 5:52:05 PM (20 hours ago)
Author:
mmaurice
Message:

Generic PCM:

Add qsurf flag in modern traceur.def (used in 1D)

MM

Location:
trunk/LMDZ.GENERIC/libf/phystd/dyn1d
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/inichim_1D.F90

    r3753 r3801  
    120120         else
    121121            write(*,*) ' Parameter value (default)     : qxf=', qxf(iq)
     122         end if
     123         if (index(tracline,'qsurf='    ) /= 0) then
     124             read(tracline(index(tracline,'qsurf=')+len('qsurf='):),*) qsurf(iq)
     125             write(*,*) ' Parameter value (traceur.def) : qsurf=', qsurf(iq)
     126         else
     127             write(*,*) ' Parameter value (default)     : qsurf=', qsurf(iq)
    122128         end if
    123129      end do
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/initracer_1D.F90

    r3781 r3801  
    33!implicit none
    44
    5     subroutine initracer_1D(nlayer, nq, pq, qsurf, play)
     5    subroutine initracer_1D(nlayer, nq, pq, pqsurf, play)
    66
    77    use tracer_h, only: noms, mmol
     
    4242    ! outputs :
    4343
    44     real,intent(out)   :: pq(nlayer,nq)  ! tracers (kg/kg_of_air)
    45     real,intent(out)   :: qsurf(nq)      ! surface values (kg/m2) of tracers
     44    real,intent(inout)   :: pq(nlayer,nq)  ! tracers (kg/kg_of_air)
     45    real,intent(inout)   :: pqsurf(nq)     ! surface values (kg/m2) of tracers
    4646
    4747    ! local :
     
    4949    real, allocatable  :: pf(:)          ! pressure in vmr profile files set in traceur.def
    5050    real, allocatable  :: qf(:)          ! vmr      in vmr profile files set in traceur.def
    51 
     51    real    :: qsurf(nq)                 ! surface tracer value
    5252    real    :: mmean(nlayer)             ! mean molecular mass (g)
    5353    real    :: pqx(nlayer,nq)            ! tracers (vmr)
     
    112112            write(*,*) ' Parameter value (default)     : qxf=', qxf(iq)
    113113        end if
     114        if (index(tracline,'qsurf='    ) /= 0) then
     115            read(tracline(index(tracline,'qsurf=')+len('qsurf='):),*) qsurf(iq)
     116            write(*,*) ' Parameter value (traceur.def) : qsurf=', qsurf(iq)
     117        else
     118            write(*,*) ' Parameter value (default)     : qsurf=', qsurf(iq)
     119        end if
    114120    end do
    115121
     
    125131                if (pq(ilay,iq) /= 0.) then
    126132                    print*, "initracer_1D: Tracer "//trim(noms(iq))//" seems to be already initialized"
    127                     print*, "              and you are now trying set it a homogeneous value (flag qx)"
     133                    print*, "              and you are now trying set it to a homogeneous value (flag qx)"
    128134                    call abort
    129135                end if
     
    134140                if (pq(ilay,iq) /= 0.) then
    135141                    print*, "initracer_1D: Tracer "//trim(noms(iq))//" seems to be already initialized"
    136                     print*, "              and you are now trying set it a homogeneous value (flag qx)"
     142                    print*, "              and you are now trying set it to an input porfile (flag qxf)"
    137143                    call abort
    138144                end if
     
    211217    end do
    212218
     219    ! surface tracers
     220    do iq=1,nq
     221        if (pqsurf(iq) == 0.) then
     222            pqsurf(iq) = qsurf(iq)
     223        else
     224            write(*,*) 'initracer_1D: you provided qsurf for '//trim(noms(iq))//' defined as background'
     225            write(*,*) '              but it seems to have already been initialized: keep previous value'
     226        end if
     227    end do
    213228    ! 4. Hard coding
     229
    214230    ! Do whatever you want here to specify pq and qsurf
    215231    ! Or use #ModernTrac-v1 and add another option section 2.
Note: See TracChangeset for help on using the changeset viewer.