Loop improvement of the frun_CEMANEIGE subroutine
The calculation of Pliq and Psol is done in the time loop. I think we can extract it from that loop. I.e. modify
!--------------------------------------------------------------
! Time loop
!--------------------------------------------------------------
DO k=1,LInputs
! SolidPrecip and LiquidPrecip
Pliq=(1.-InputsFracSolidPrecip(k))*InputsPrecip(k)
Psol=InputsFracSolidPrecip(k)*InputsPrecip(k)
to
! SolidPrecip and LiquidPrecip
Pliq=(1.-InputsFracSolidPrecip)*InputsPrecip
Psol=InputsFracSolidPrecip*InputsPrecip
!--------------------------------------------------------------
! Time loop
!--------------------------------------------------------------
DO k=1,LInputs
and then replace all Pliq
and Psol
by Pliq(k)
and Psol(k)
.
Does it run faster @olivier.delaigue? A proposition of code is attached. frun_CEMANEIGE.f90