Loading oper/launcher +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ set -e # target executable: exe='tutorial_oper_S5p.x' exe='tutorial_oper_simulate.x' #exe='tutorial_oper_adj-test.x' Loading oper/launcher-mpi +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ set -e # target executable: exe='tutorial_oper_S5p.x' exe='tutorial_oper_simulate.x' #exe='tutorial_oper_adj-test.x' # number of processors: Loading oper/src/Makefile +2 −5 Original line number Diff line number Diff line Loading @@ -55,11 +55,8 @@ include Makefile_deps deps: makedepf90 $(FFLAGS_DEFINE) *.F90 > Makefile_deps tutorial_oper_S5p.x: tutorial_oper_S5p.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_S5p.o cso*.o $(LIBS) tutorial_oper_S4-syn.x: tutorial_oper_S4-syn.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_S4-syn.o cso*.o $(LIBS) tutorial_oper_simulate.x: tutorial_oper_simulate.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_simulate.o cso*.o $(LIBS) tutorial_oper_adj-test.x: tutorial_oper_adj-test.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_adj-test.o cso*.o $(LIBS) Loading oper/src/Makefile_deps +1 −1 Original line number Diff line number Diff line Loading @@ -19,4 +19,4 @@ cso_string.o : cso_string.F90 cso.inc cso_logging.o cso_swapping.o : cso_swapping.F90 cso.inc cso_parray.o cso_domains.o cso_comm.o cso_logging.o cso_tools.o : cso_tools.F90 cso.inc cso_logging.o tutorial_oper_adj-test.o : tutorial_oper_adj-test.F90 cso.inc cso.o tutorial_oper_S5p.o : tutorial_oper_S5p.F90 cso.inc cso.o tutorial_oper_simulate.o : tutorial_oper_simulate.F90 cso.inc cso.o oper/src/tutorial_oper_S5p.F90→oper/src/tutorial_oper_simulate.F90 +31 −15 Original line number Diff line number Diff line !################################################################# ! ! CSO Tutorial for observation operator code. ! Application on S5p data. ! Application on for example S5p/NO2 or CrIS/NH3 data. ! ! CHANGES ! Loading @@ -14,6 +14,7 @@ ! ! 2026-07, Arjo Segers ! Pixel selection based on time values rather than orbit file. ! Added template for CrIS/NH3 processing. ! ! !### macro's ##################################################### Loading @@ -26,7 +27,7 @@ ! !################################################################# program Tutorial_Oper_S5p program Tutorial_Oper_Simulate #ifdef _MPI use MPI_F08, only : MPI_Comm Loading @@ -52,7 +53,7 @@ program Tutorial_Oper_S5p ! --- const ---------------------------------------------------------- character(len=*), parameter :: rname = 'Tutorial_Oper_S5p' character(len=*), parameter :: rname = 'Tutorial_Oper_Simulate' ! gravity constant: real, parameter :: grav = 9.80665 ! m/s2 Loading Loading @@ -162,6 +163,8 @@ program Tutorial_Oper_S5p integer :: iuvar character(len=64), allocatable :: uvarnames(:) ! (nuvar) character(len=64), allocatable :: uvarunits(:) ! (nuvar) character(len=128) :: conversion real :: vfac ! pixel counter and index: integer :: npix, npix_all Loading Loading @@ -278,15 +281,15 @@ program Tutorial_Oper_S5p ! settings !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !! input settings: !rcfile = 'tutorial_oper_S5p.rc' !! base of keywords in rcfile: !rcbase = 'tutorial.S5p.no2' ! input settings: rcfile = 'tutorial_oper_S5p.rc' rcfile = 'tutorial_oper_CrIS.rc' ! base of keywords in rcfile: rcbase = 'tutorial.S5p.no2' !!~ input settings for synthetic S4/NO2 !rcfile = 'tutorial_oper_S4-syn.rc' !! base of keywords in rcfile: !rcbase = 'tutorial.S4-syn.no2' rcbase = 'tutorial.cris.nh3' ! info ... write (logfu,'(a,": settings file: ",a)') rname, trim(rcfile) Loading Loading @@ -652,10 +655,23 @@ program Tutorial_Oper_S5p !~ model concentrations case ( 'mod_conc' ) ! check units: if ( trim(uvarunits(iuvar)) /= trim(conc_units) ) then write (logfu,'("ERROR - variable `",a,"` requires conversion to `",a,"` from `",a,"`")') & trim(uvarnames(iuvar)), trim(uvarunits(iuvar)), trim(conc_units) if ( trim(conc_units) /= trim(uvarunits(iuvar)) ) then ! conversion description: write (conversion,'(a," -> ",a)') trim(conc_units), trim(uvarunits(iuvar)) ! switch: select case ( conversion ) ! factor: case ( 'ppb -> ppmv' ) vfac = 1.0e-3 ! case default write (logfu,'("unsupported conversion `",a,"` for variable `",a,"`")') & trim(conversion), trim(uvarnames(iuvar)) TRACEBACK; status=1; call Exit(status) end select else ! no conversion factor needed: vfac = 1.0 end if ! get pointer to target array with shape (nz,npix): call sstate%GetData( status, name=uvarnames(iuvar), data1=data1 ) Loading @@ -671,7 +687,7 @@ program Tutorial_Oper_S5p ! loop over source contributions: do iw = iw0(ipix)+1, iw0(ipix)+nw(ipix) ! add contribution: data1(:,ipix) = data1(:,ipix) + conc(ii(iw),jj(iw),:) * ww(iw)/areas(ipix) data1(:,ipix) = data1(:,ipix) + conc(ii(iw),jj(iw),:) * vfac * ww(iw)/areas(ipix) end do ! iw end if ! nw > 0 end do ! itsel Loading Loading @@ -848,6 +864,6 @@ program Tutorial_Oper_S5p write (logfu,'(a,": ** end **")') rname write (logfu,'(a,":")') rname end program Tutorial_Oper_S5p end program Tutorial_Oper_Simulate Loading
oper/launcher +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ set -e # target executable: exe='tutorial_oper_S5p.x' exe='tutorial_oper_simulate.x' #exe='tutorial_oper_adj-test.x' Loading
oper/launcher-mpi +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ set -e # target executable: exe='tutorial_oper_S5p.x' exe='tutorial_oper_simulate.x' #exe='tutorial_oper_adj-test.x' # number of processors: Loading
oper/src/Makefile +2 −5 Original line number Diff line number Diff line Loading @@ -55,11 +55,8 @@ include Makefile_deps deps: makedepf90 $(FFLAGS_DEFINE) *.F90 > Makefile_deps tutorial_oper_S5p.x: tutorial_oper_S5p.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_S5p.o cso*.o $(LIBS) tutorial_oper_S4-syn.x: tutorial_oper_S4-syn.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_S4-syn.o cso*.o $(LIBS) tutorial_oper_simulate.x: tutorial_oper_simulate.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_simulate.o cso*.o $(LIBS) tutorial_oper_adj-test.x: tutorial_oper_adj-test.o $(FC) -o $@ $(LDFLAGS) tutorial_oper_adj-test.o cso*.o $(LIBS) Loading
oper/src/Makefile_deps +1 −1 Original line number Diff line number Diff line Loading @@ -19,4 +19,4 @@ cso_string.o : cso_string.F90 cso.inc cso_logging.o cso_swapping.o : cso_swapping.F90 cso.inc cso_parray.o cso_domains.o cso_comm.o cso_logging.o cso_tools.o : cso_tools.F90 cso.inc cso_logging.o tutorial_oper_adj-test.o : tutorial_oper_adj-test.F90 cso.inc cso.o tutorial_oper_S5p.o : tutorial_oper_S5p.F90 cso.inc cso.o tutorial_oper_simulate.o : tutorial_oper_simulate.F90 cso.inc cso.o
oper/src/tutorial_oper_S5p.F90→oper/src/tutorial_oper_simulate.F90 +31 −15 Original line number Diff line number Diff line !################################################################# ! ! CSO Tutorial for observation operator code. ! Application on S5p data. ! Application on for example S5p/NO2 or CrIS/NH3 data. ! ! CHANGES ! Loading @@ -14,6 +14,7 @@ ! ! 2026-07, Arjo Segers ! Pixel selection based on time values rather than orbit file. ! Added template for CrIS/NH3 processing. ! ! !### macro's ##################################################### Loading @@ -26,7 +27,7 @@ ! !################################################################# program Tutorial_Oper_S5p program Tutorial_Oper_Simulate #ifdef _MPI use MPI_F08, only : MPI_Comm Loading @@ -52,7 +53,7 @@ program Tutorial_Oper_S5p ! --- const ---------------------------------------------------------- character(len=*), parameter :: rname = 'Tutorial_Oper_S5p' character(len=*), parameter :: rname = 'Tutorial_Oper_Simulate' ! gravity constant: real, parameter :: grav = 9.80665 ! m/s2 Loading Loading @@ -162,6 +163,8 @@ program Tutorial_Oper_S5p integer :: iuvar character(len=64), allocatable :: uvarnames(:) ! (nuvar) character(len=64), allocatable :: uvarunits(:) ! (nuvar) character(len=128) :: conversion real :: vfac ! pixel counter and index: integer :: npix, npix_all Loading Loading @@ -278,15 +281,15 @@ program Tutorial_Oper_S5p ! settings !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !! input settings: !rcfile = 'tutorial_oper_S5p.rc' !! base of keywords in rcfile: !rcbase = 'tutorial.S5p.no2' ! input settings: rcfile = 'tutorial_oper_S5p.rc' rcfile = 'tutorial_oper_CrIS.rc' ! base of keywords in rcfile: rcbase = 'tutorial.S5p.no2' !!~ input settings for synthetic S4/NO2 !rcfile = 'tutorial_oper_S4-syn.rc' !! base of keywords in rcfile: !rcbase = 'tutorial.S4-syn.no2' rcbase = 'tutorial.cris.nh3' ! info ... write (logfu,'(a,": settings file: ",a)') rname, trim(rcfile) Loading Loading @@ -652,10 +655,23 @@ program Tutorial_Oper_S5p !~ model concentrations case ( 'mod_conc' ) ! check units: if ( trim(uvarunits(iuvar)) /= trim(conc_units) ) then write (logfu,'("ERROR - variable `",a,"` requires conversion to `",a,"` from `",a,"`")') & trim(uvarnames(iuvar)), trim(uvarunits(iuvar)), trim(conc_units) if ( trim(conc_units) /= trim(uvarunits(iuvar)) ) then ! conversion description: write (conversion,'(a," -> ",a)') trim(conc_units), trim(uvarunits(iuvar)) ! switch: select case ( conversion ) ! factor: case ( 'ppb -> ppmv' ) vfac = 1.0e-3 ! case default write (logfu,'("unsupported conversion `",a,"` for variable `",a,"`")') & trim(conversion), trim(uvarnames(iuvar)) TRACEBACK; status=1; call Exit(status) end select else ! no conversion factor needed: vfac = 1.0 end if ! get pointer to target array with shape (nz,npix): call sstate%GetData( status, name=uvarnames(iuvar), data1=data1 ) Loading @@ -671,7 +687,7 @@ program Tutorial_Oper_S5p ! loop over source contributions: do iw = iw0(ipix)+1, iw0(ipix)+nw(ipix) ! add contribution: data1(:,ipix) = data1(:,ipix) + conc(ii(iw),jj(iw),:) * ww(iw)/areas(ipix) data1(:,ipix) = data1(:,ipix) + conc(ii(iw),jj(iw),:) * vfac * ww(iw)/areas(ipix) end do ! iw end if ! nw > 0 end do ! itsel Loading Loading @@ -848,6 +864,6 @@ program Tutorial_Oper_S5p write (logfu,'(a,": ** end **")') rname write (logfu,'(a,":")') rname end program Tutorial_Oper_S5p end program Tutorial_Oper_Simulate