diff --git a/.github/workflows/containerized-ci.yml b/.github/workflows/containerized-ci.yml index c9c3ce9de..8b9fdc028 100644 --- a/.github/workflows/containerized-ci.yml +++ b/.github/workflows/containerized-ci.yml @@ -75,6 +75,7 @@ jobs: with: repository: earth-system-radiation/rrtmgp-data path: rrtmgp-data + ref: feature-timing # # Cache RFMIP files # diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 928bbb09d..714899782 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -47,6 +47,7 @@ jobs: with: repository: earth-system-radiation/rrtmgp-data path: rrtmgp-data + ref: feature-timing # # Synchronize the package index # diff --git a/.github/workflows/self-hosted-ci.yml b/.github/workflows/self-hosted-ci.yml index 0b0e1c90c..f07dfd6f9 100644 --- a/.github/workflows/self-hosted-ci.yml +++ b/.github/workflows/self-hosted-ci.yml @@ -62,6 +62,7 @@ jobs: with: repository: earth-system-radiation/rrtmgp-data path: rrtmgp-data + ref: feature-timing # # Finalize build environment # diff --git a/examples/all-sky/Makefile b/examples/all-sky/Makefile index 228017e70..8cc1b4885 100644 --- a/examples/all-sky/Makefile +++ b/examples/all-sky/Makefile @@ -43,8 +43,8 @@ rrtmgp_allsky.o: $(ADDITIONS) rrtmgp_allsky.F90 mo_cloud_optics_rrtmgp.o: mo_cloud_optics_rrtmgp.F90 mo_aerosol_optics_rrtmgp_merra.o: mo_aerosol_optics_rrtmgp_merra.F90 -mo_load_coefficients.o: mo_simple_netcdf.o mo_load_coefficients.F90 -mo_load_cloud_coefficients.o: mo_simple_netcdf.o mo_cloud_optics_rrtmgp.o mo_load_cloud_coefficients.F90 +mo_load_coefficients.o: mo_simple_netcdf.o mo_load_coefficients.F90 +mo_load_cloud_coefficients.o: mo_simple_netcdf.o mo_cloud_optics_rrtmgp.o mo_load_cloud_coefficients.F90 mo_load_aerosol_coefficients.o: mo_simple_netcdf.o mo_aerosol_optics_rrtmgp_merra.o mo_load_aerosol_coefficients.F90 tests: @@ -52,8 +52,8 @@ tests: $(RUN_CMD) ./rrtmgp_allsky 24 72 1 rrtmgp-allsky.nc ${RRTMGP_DATA}/rrtmgp-gas-sw-g224.nc ${RRTMGP_DATA}/rrtmgp-clouds-sw.nc ${RRTMGP_DATA}/rrtmgp-aerosols-merra-sw.nc check: - echo "No checking of all sky results at this time" - # python ./compare-to-reference.py + python ./compare-to-reference.py --allsky_file rrtmgp-allsky-lw.nc + python ./compare-to-reference.py --allsky_file rrtmgp-allsky-sw.nc clean: -rm rrtmgp_allsky *.o *.optrpt ../*.optrpt *.mod *.nc diff --git a/examples/all-sky/compare-to-reference.py b/examples/all-sky/compare-to-reference.py index e57a42489..54923a6f9 100644 --- a/examples/all-sky/compare-to-reference.py +++ b/examples/all-sky/compare-to-reference.py @@ -16,7 +16,7 @@ parser = argparse.ArgumentParser( description="Compares all-sky example output to file in reference " "directory") - parser.add_argument("--allsky_file", type=str, default="rrtmgp-allsky.nc", + parser.add_argument("--allsky_file", type=str, default="rrtmgp-allsky-lw.nc", dest="file", help="Name of file inputs and outputs for " "all-sky problem (same for test and reference)") @@ -35,13 +35,13 @@ ref = xr.open_dataset(ref_file) failed = False - for v in ['lw_flux_up', 'lw_flux_dn', 'sw_flux_up', 'sw_flux_dn', - 'sw_flux_dir']: + for v in tst.variables: + if np.any(np.isnan(ref.variables[v].values)): + raise Exception(v + ": some ref values are missing. Now that is strange.") if np.all(np.isnan(tst.variables[v].values)): raise Exception("All test values are missing. Were the tests run?") if np.any(np.isnan(tst.variables[v].values)): - raise Exception( - "Some test values are missing. Now that is strange.") + raise Exception(v + ":Some test values are missing. Now that is strange.") # express as (tst-ref).variables[v].values when replacing reference file # to have same number of columns diff --git a/examples/all-sky/rrtmgp_allsky.F90 b/examples/all-sky/rrtmgp_allsky.F90 index fe3f10a23..1de5737c1 100644 --- a/examples/all-sky/rrtmgp_allsky.F90 +++ b/examples/all-sky/rrtmgp_allsky.F90 @@ -357,15 +357,10 @@ program rte_rrtmgp_clouds_aerosols call system_clock(finish_all, clock_rate) ! Release GPU memory for p_lay, t_lay, p_lev, t_lev, q, o3) - !$acc exit data delete(p_lay, p_lev, t_lay, t_lev) + !$acc exit data delete( p_lay, p_lev, t_lay, t_lev) !$omp target exit data map(release:p_lay, p_lev, t_lay, t_lev) - if(do_clouds) then - !$acc exit data delete( lwp, iwp, rel, rei) - !$omp target exit data map(release:lwp, iwp, rel, rei) - end if - ! - ! TK - release aerosol memory - ! + + ! Memory for clouds and aerosols is released in write-fluxes #if defined(_OPENACC) || defined(_OPENMP) avg = sum( elapsed(merge(2,1,nloops>1):) ) / real(merge(nloops-1,nloops,nloops>1)) @@ -681,8 +676,8 @@ subroutine write_fluxes ! ! Define dimensions ! - if(nf90_create("rrmtgp_allsky_" // merge("lw", "sw", is_lw) // ".nc", NF90_CLOBBER, ncid) /= NF90_NOERR) & - call stop_on_err("rrtmgp_allsky: can't create file rrmtgp_allsky_" // merge("lw", "sw", is_lw) // ".nc") + if(nf90_create("rrtmgp-allsky-" // merge("lw", "sw", is_lw) // ".nc", NF90_CLOBBER, ncid) /= NF90_NOERR) & + call stop_on_err("rrtmgp_allsky: can't create file rrmtgp-allsky-" // merge("lw", "sw", is_lw) // ".nc") if(nf90_def_dim(ncid, "col", ncol, col_dim) /= NF90_NOERR) & call stop_on_err("rrtmgp_allsky: can't define col dimension") @@ -739,6 +734,14 @@ subroutine write_fluxes call stop_on_err(gas_concs%get_vmr("o3", vmr)) call stop_on_err(write_field(ncid, "o3", vmr)) + if(do_clouds) then + !$acc exit data delete( lwp, iwp, rel, rei) + !$omp target exit data map(release:lwp, iwp, rel, rei) + end if + + if(do_aerosols) then + end if + ! Fluxes - writing !$acc exit data copyout( flux_up, flux_dn) !$omp target exit data map(from:flux_up, flux_dn)