MODULE tracers !----------------------------------------------------------------------- ! NAME ! tracers ! ! DESCRIPTION ! Tracer species management for tracking. ! ! AUTHORS & DATE ! JB Clement, 12/2025 ! ! NOTES ! !----------------------------------------------------------------------- ! DECLARATION ! ----------- implicit none ! MODULE VARIABLES ! ---------------- integer :: iPCM_qh2o ! Index for H2O vapor tracer from PCM real, dimension(:), allocatable :: mmol ! Molar masses of tracers [g/mol] contains !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ !======================================================================= SUBROUTINE ini_tracers_id(nqtot,noms) !----------------------------------------------------------------------- ! NAME ! ini_tracers_id ! ! DESCRIPTION ! Initialize tracer indices from PCM tracer names. ! ! AUTHORS & DATE ! JB Clement, 12/2025 ! ! NOTES ! !----------------------------------------------------------------------- ! DECLARATION ! ----------- implicit none ! ARGUMENTS ! --------- integer, intent(in) :: nqtot ! Total number of tracers character(*), dimension(nqtot), intent(in) :: noms ! Names of tracers ! LOCAL VARIABLES ! --------------- integer :: i ! CODE ! ---- ! Allocation call ini_tracers(nqtot) ! Initialization iPCM_qh2o = -1 ! Getting the index do i = 1,nqtot if (noms(i) == "h2o_vap") then iPCM_qh2o = i mmol(i) = 18. endif enddo ! Checking if everything has been found if (iPCM_qh2o < 0) error stop 'ini_frost_id: H2O vapour index not found!' END SUBROUTINE ini_tracers_id !======================================================================= !======================================================================= SUBROUTINE ini_tracers(nqtot) !----------------------------------------------------------------------- ! NAME ! ini_tracers ! ! DESCRIPTION ! Allocate tracer molar mass array. ! ! AUTHORS & DATE ! JB Clement, 12/2025 ! ! NOTES ! !----------------------------------------------------------------------- ! DECLARATION ! ----------- implicit none ! ARGUMENTS ! --------- integer, intent(in) :: nqtot ! Total number of tracers ! CODE ! ---- if (.not. allocated(mmol)) allocate(mmol(nqtot)) END SUBROUTINE ini_tracers !======================================================================= !======================================================================= SUBROUTINE end_tracers() !----------------------------------------------------------------------- ! NAME ! end_tracers ! ! DESCRIPTION ! Deallocate tracer molar mass array. ! ! AUTHORS & DATE ! JB Clement, 12/2025 ! ! NOTES ! !----------------------------------------------------------------------- ! DECLARATION ! ----------- implicit none ! CODE ! ---- if (allocated(mmol)) deallocate(mmol) END SUBROUTINE end_tracers !======================================================================= END MODULE tracers