Commit
21426fea400c37cfd10dbde5beb0f96690a2f838
by noreplyRestructuring and Porting of Compute_mixing_length subroutine(Phase 1) (#1052)
* Restructuring and Porting of Compute_mixing_length subroutine(Phase 1)
Restructure: The compute_mixing_length is one of the top most routine taking 35-50%
of the total time in a single timestep. The subroutine has been restructured to
push the i-loop further down to extract vectorization and parallelization.
The restructuring also involves introduction of sat_mixrat_liq_acc routines to
extract parallelism when called inside a OpenACC parallel region.
Porting: OpenACC directives are inserted to port the restructured compute_mixing_length
code on to the GPUs. This port is currently unoptimized and there is still room for improvement.
NOTE: Currently, l_sat_mixrat_lookup = false and saturation_formula = saturation_flatau
(Earthworks config options) case is supported on OpenACC build. Any other options works
on CPUs as usual. OpenACC declare create directives are inserted in model_flags and
constants_clubb, as these module variables are used inside the saturation routines.
* Added debug message about only supporting
l_sat_mixrat_lookup = false and saturation_formula = saturation_flatau
on GPUs
Answers are Bit for Bit with arm-multicolumn case + nvhpc compiler.
* Changing CLUBB debug level 1 to 0 for the saturation formula support
running on GPUs
* Changing indentation to make gfortran happy, it wants ifdefs to start at the beginning of the line.
* Adding use statements for error checks and printouts, also making the errors set err_code to clubb_fatal_error.
Co-authored-by: huebler <huebler@uwm.edu>