The shr_wv_sat_init() call is required to to use shr_wv_sat_qsat_liquid() routine and similar ones to calculate the saturation mixing ratio from the tables but the current implementation assumes that the CMEPS flux calculation will be only used by CESM and its driver. Since we are coupling MPAS and MOM6 outside of the CESM framework (at this point) through ESMX driver, the shr_wv_sat_qsat_liquid() call returns all zero and flux calculation is messed up. As I see those codes are under driver and it makes sense but I think moving those outside of the driver code and init through the med.F90 rather then esm.F90 would make it more generic and it could be also used by UFS WM (I did not check their driver has this init call or not yet) and other projects like ours.
The
shr_wv_sat_init()call is required to to useshr_wv_sat_qsat_liquid()routine and similar ones to calculate the saturation mixing ratio from the tables but the current implementation assumes that the CMEPS flux calculation will be only used by CESM and its driver. Since we are coupling MPAS and MOM6 outside of the CESM framework (at this point) through ESMX driver, theshr_wv_sat_qsat_liquid()call returns all zero and flux calculation is messed up. As I see those codes are under driver and it makes sense but I think moving those outside of the driver code and init through themed.F90rather thenesm.F90would make it more generic and it could be also used by UFS WM (I did not check their driver has this init call or not yet) and other projects like ours.