Skip to content

adding tracers#3

Open
gbolzon wants to merge 18 commits into
masterfrom
2-adding-tracers
Open

adding tracers#3
gbolzon wants to merge 18 commits into
masterfrom
2-adding-tracers

Conversation

@gbolzon

@gbolzon gbolzon commented Mar 7, 2025

Copy link
Copy Markdown
Collaborator

Adding 2 tracers to:

  • BFMcoupler_LOAD.h
  • BFMcoupler_VARS.h
  • BFMcoupler_calc_tendency.F
  • BFMcoupler_fields_load.F
  • BFMcoupler_ini_forcing.F
  • BFMcoupler_readparams.F

@gbolzon gbolzon linked an issue Mar 7, 2025 that may be closed by this pull request
@gbolzon gbolzon requested a review from stefanoquerin March 10, 2025 15:52
@gbolzon

gbolzon commented Mar 10, 2025

Copy link
Copy Markdown
Collaborator Author

diff_apply deve fare su GAD_OPTIONS.h

-#undef GAD_ALLOW_TS_SOM_ADV
+#define GAD_ALLOW_TS_SOM_ADV

E su OBCS_PARAMS.h
PARAMETER ( OBCS_tideCompSize = 8 )

@gbolzon

gbolzon commented Mar 10, 2025

Copy link
Copy Markdown
Collaborator Author

Su EXF_OPTIONS.h

#define  ALLOW_RUNOFTEMP
# define EXF_CALC_ATMRHO
# define ALLOW_ZENITHANGLE
#define USE_EXF_INTERPOLATION

@gbolzon

gbolzon commented Mar 11, 2025

Copy link
Copy Markdown
Collaborator Author

@stefanoquerin I thing the code is ready

  • diff_apply covers all files we need (excluding swfrac.F)
  • CONC01, CONC02 ... are the new names

@gbolzon

gbolzon commented May 10, 2025

Copy link
Copy Markdown
Collaborator Author

The mechanism:

LINES, position_line = strings_and_position(inputfile, searchstring)
diff_apply.insert_lines(...new_lines,, position_line)

has this behaviour:
If searchstring corresponds to line 77 of inputfile, ==> position_line=76
No, inside insert_lines(), the firsts 76 lines are replicated.
Then we add the new lines.
So, they are applied just before line 77, while the docstring says 'after'

@gbolzon

gbolzon commented May 10, 2025

Copy link
Copy Markdown
Collaborator Author

We are correcting here some bugs in migration 66j --> 68z

  1. gchem_apply_tendency needs 2 new variables defined in gchem_tr_register.F, which needs BFMcoupler_tr_register.F

We need MITgcm/pkg/gchem/gchem_tr_register.F with this patch

+#ifdef ALLOW_BFMCOUPLER
+      IF ( useBFMcoupler ) THEN
+        CALL BFMcoupler_TR_REGISTER(
+     U                gchem_Tracer_num, gchem_sepFTr_num,
+     I                myThid )
+      ENDIF
+#endif

applied before line 90 WRITE(msgBuf,'(2A,2I5)') 'GCHEM_TR_REGISTER: ',

  1. In order to read the added tracers, the main cycle of

    DO bj = myByLo(myThid), myByHi(myThid)
    DO bi = myBxLo(myThid), myBxHi(myThid)

    must be closed after the added tracers, not here!
    ENDDO
    ENDDO
    C Adding tracers
    IF ( BFMcoupler_CONC01BotForcFile.NE. ' ' ) THEN
    DO j=1-OLy,sNy+OLy

  2. In BFMcoupler_calc_tendency.F decay of passive tracers is working only with BFMv2

Giorgio Bolzon added 3 commits May 10, 2025 15:55
…er.F (which defines gchem_Tracer_num, gchem_sepFTr_num) which calls BFMcoupler_tr_register.F.

diff_apply.py introduces in  gchem_tr_register.F the call to BFMcoupler_tr_register.F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding tracers

1 participant