From a03df4712714212e5c2a86cdec91a35e6b0ac0c4 Mon Sep 17 00:00:00 2001 From: hklion Date: Mon, 9 Oct 2023 23:30:09 +0000 Subject: [PATCH] Deployed from seahorce-scidac/ROMSX --- classROMSX.html | 183 ++++++++++++++++++++++++------------------------ 1 file changed, 93 insertions(+), 90 deletions(-) diff --git a/classROMSX.html b/classROMSX.html index 91cc89d9..ac4c76df 100644 --- a/classROMSX.html +++ b/classROMSX.html @@ -1361,100 +1361,103 @@

582  });
583  } // MFIter
584 
-
585  mf_temp.FillBoundary(geom[lev].periodicity());
-
586  mf_salt.FillBoundary(geom[lev].periodicity());
-
587  mf_tempold.FillBoundary(geom[lev].periodicity());
-
588  mf_saltold.FillBoundary(geom[lev].periodicity());
-
589  vec_t3[lev]->FillBoundary(geom[lev].periodicity());
-
590  vec_s3[lev]->FillBoundary(geom[lev].periodicity());
-
591  vec_Huon[lev]->FillBoundary(geom[lev].periodicity());
-
592  vec_Hvom[lev]->FillBoundary(geom[lev].periodicity());
-
593 
- -
595  bool predictor_2d_step=true;
-
596  bool first_2d_step=(iic==ntfirst);
-
597  int nfast_counter=predictor_2d_step ? nfast : nfast-1;
-
598  nfast_counter += 1;
-
599  //Compute fast timestep from dt_lev and ratio
-
600  Real dtfast_lev=dt_lev/Real(fixed_ndtfast_ratio);
-
601  int next_indx1 = 0;
-
602  for(int my_iif = 0; my_iif < nfast_counter; my_iif++) {
-
603  first_2d_step=(my_iif==0);
-
604  //Predictor
-
605  predictor_2d_step=true;
-
606  advance_2d(lev, mf_u, mf_v, mf_rhoS, mf_rhoA, vec_ru[lev], vec_rv[lev],
-
607  vec_rufrc[lev], vec_rvfrc[lev],
-
608  vec_Zt_avg1[lev],
-
609  vec_DU_avg1[lev], vec_DU_avg2[lev],
-
610  vec_DV_avg1[lev], vec_DV_avg2[lev],
-
611  vec_rubar[lev], vec_rvbar[lev], vec_rzeta[lev],
-
612  vec_ubar[lev], vec_vbar[lev], vec_zeta[lev],
- -
614  ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif, nfast, next_indx1);
-
615 
-
616  //Corrector. Skip it on last fast step
-
617  predictor_2d_step=false;
-
618  if (my_iif < nfast_counter - 1) {
-
619  advance_2d(lev, mf_u, mf_v, mf_rhoS, mf_rhoA, vec_ru[lev], vec_rv[lev],
-
620  vec_rufrc[lev], vec_rvfrc[lev],
-
621  vec_Zt_avg1[lev],
-
622  vec_DU_avg1[lev], vec_DU_avg2[lev],
-
623  vec_DV_avg1[lev], vec_DV_avg2[lev],
-
624  vec_rubar[lev], vec_rvbar[lev], vec_rzeta[lev],
-
625  vec_ubar[lev], vec_vbar[lev], vec_zeta[lev],
- -
627  ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif, nfast, next_indx1);
-
628  }
-
629  }
-
630  }
-
631 
-
632  // Currently, bathymetry doesn't change, so we do not need to re-set h here. Just re-do stretch, etc
-
633  // because zeta may have changed
-
634  stretch_transform(lev);
-
635 
-
636  advance_3d(lev, mf_u, mf_v, mf_tempold, mf_saltold, mf_temp, mf_salt, vec_t3[lev], vec_s3[lev], vec_ru[lev], vec_rv[lev],
-
637  vec_DU_avg1[lev], vec_DU_avg2[lev],
-
638  vec_DV_avg1[lev], vec_DV_avg2[lev],
-
639  vec_ubar[lev], vec_vbar[lev],
-
640  mf_AK, mf_DC,
-
641  mf_Hzk, vec_Akv[lev], vec_Akt[lev], vec_Hz[lev], vec_Huon[lev], vec_Hvom[lev], vec_z_w[lev], vec_hOfTheConfusingName[lev], ncomp, N, dt_lev);
-
642 
-
643  U_new.FillBoundary(geom[lev].periodicity());
-
644  V_new.FillBoundary(geom[lev].periodicity());
+
585  // Update Akv with new depth. NOTE: this happens before set_zeta in ROMS
+
586  set_vmix(lev);
+
587 
+
588  mf_temp.FillBoundary(geom[lev].periodicity());
+
589  mf_salt.FillBoundary(geom[lev].periodicity());
+
590  mf_tempold.FillBoundary(geom[lev].periodicity());
+
591  mf_saltold.FillBoundary(geom[lev].periodicity());
+
592  vec_t3[lev]->FillBoundary(geom[lev].periodicity());
+
593  vec_s3[lev]->FillBoundary(geom[lev].periodicity());
+
594  vec_Huon[lev]->FillBoundary(geom[lev].periodicity());
+
595  vec_Hvom[lev]->FillBoundary(geom[lev].periodicity());
+
596 
+ +
598  bool predictor_2d_step=true;
+
599  bool first_2d_step=(iic==ntfirst);
+
600  int nfast_counter=predictor_2d_step ? nfast : nfast-1;
+
601  nfast_counter += 1;
+
602  //Compute fast timestep from dt_lev and ratio
+
603  Real dtfast_lev=dt_lev/Real(fixed_ndtfast_ratio);
+
604  int next_indx1 = 0;
+
605  for(int my_iif = 0; my_iif < nfast_counter; my_iif++) {
+
606  first_2d_step=(my_iif==0);
+
607  //Predictor
+
608  predictor_2d_step=true;
+
609  advance_2d(lev, mf_u, mf_v, mf_rhoS, mf_rhoA, vec_ru[lev], vec_rv[lev],
+
610  vec_rufrc[lev], vec_rvfrc[lev],
+
611  vec_Zt_avg1[lev],
+
612  vec_DU_avg1[lev], vec_DU_avg2[lev],
+
613  vec_DV_avg1[lev], vec_DV_avg2[lev],
+
614  vec_rubar[lev], vec_rvbar[lev], vec_rzeta[lev],
+
615  vec_ubar[lev], vec_vbar[lev], vec_zeta[lev],
+ +
617  ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif, nfast, next_indx1);
+
618 
+
619  //Corrector. Skip it on last fast step
+
620  predictor_2d_step=false;
+
621  if (my_iif < nfast_counter - 1) {
+
622  advance_2d(lev, mf_u, mf_v, mf_rhoS, mf_rhoA, vec_ru[lev], vec_rv[lev],
+
623  vec_rufrc[lev], vec_rvfrc[lev],
+
624  vec_Zt_avg1[lev],
+
625  vec_DU_avg1[lev], vec_DU_avg2[lev],
+
626  vec_DV_avg1[lev], vec_DV_avg2[lev],
+
627  vec_rubar[lev], vec_rvbar[lev], vec_rzeta[lev],
+
628  vec_ubar[lev], vec_vbar[lev], vec_zeta[lev],
+ +
630  ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif, nfast, next_indx1);
+
631  }
+
632  }
+
633  }
+
634 
+
635  // Currently, bathymetry doesn't change, so we do not need to re-set h here. Just re-do stretch, etc
+
636  // because zeta may have changed
+
637  stretch_transform(lev);
+
638 
+
639  advance_3d(lev, mf_u, mf_v, mf_tempold, mf_saltold, mf_temp, mf_salt, vec_t3[lev], vec_s3[lev], vec_ru[lev], vec_rv[lev],
+
640  vec_DU_avg1[lev], vec_DU_avg2[lev],
+
641  vec_DV_avg1[lev], vec_DV_avg2[lev],
+
642  vec_ubar[lev], vec_vbar[lev],
+
643  mf_AK, mf_DC,
+
644  mf_Hzk, vec_Akv[lev], vec_Akt[lev], vec_Hz[lev], vec_Huon[lev], vec_Hvom[lev], vec_z_w[lev], vec_hOfTheConfusingName[lev], ncomp, N, dt_lev);
645 
-
646  U_old.FillBoundary(geom[lev].periodicity());
-
647  V_old.FillBoundary(geom[lev].periodicity());
+
646  U_new.FillBoundary(geom[lev].periodicity());
+
647  V_new.FillBoundary(geom[lev].periodicity());
648 
-
649  mf_temp.FillBoundary(geom[lev].periodicity());
-
650  mf_salt.FillBoundary(geom[lev].periodicity());
+
649  U_old.FillBoundary(geom[lev].periodicity());
+
650  V_old.FillBoundary(geom[lev].periodicity());
651 
-
652  mf_tempold.FillBoundary(geom[lev].periodicity());
-
653  mf_saltold.FillBoundary(geom[lev].periodicity());
+
652  mf_temp.FillBoundary(geom[lev].periodicity());
+
653  mf_salt.FillBoundary(geom[lev].periodicity());
654 
-
655  vec_t3[lev]->FillBoundary(geom[lev].periodicity());
-
656  vec_s3[lev]->FillBoundary(geom[lev].periodicity());
+
655  mf_tempold.FillBoundary(geom[lev].periodicity());
+
656  mf_saltold.FillBoundary(geom[lev].periodicity());
657 
-
658  for (int lev = 0; lev <= finest_level; ++lev) {
-
659  FillPatch(lev, t_new[lev], vars_new[lev]);
-
660  }
-
661 
-
662 #ifdef ROMSX_USE_PARTICLES
-
663  // Update tracer particles on level 0
-
664  if (lev == 0 && use_tracer_particles) {
-
665  MultiFab* Umac = &vars_new[lev][Vars::xvel];
-
666  tracer_particles->AdvectWithUmac(Umac, lev, dt_lev, *vec_z_phys_nd[0]);
-
667  }
-
668 #endif
-
669 
-
670 
-
671  //We are not storing computed W aka Omega
-
672  // MultiFab::Copy(W_new,mf_w,0,0,W_new.nComp(),IntVect(AMREX_D_DECL(NGROW-1,NGROW-1,0)));
-
673  // W_new.FillBoundary();
-
674  // MultiFab::Copy(mf_W,S_old,Omega_comp,0,mf_W.nComp(),mf_w.nGrowVect());
-
675 
-
676 // set_drag(lev);
-
677 
-
678 }
+
658  vec_t3[lev]->FillBoundary(geom[lev].periodicity());
+
659  vec_s3[lev]->FillBoundary(geom[lev].periodicity());
+
660 
+
661  for (int lev = 0; lev <= finest_level; ++lev) {
+
662  FillPatch(lev, t_new[lev], vars_new[lev]);
+
663  }
+
664 
+
665 #ifdef ROMSX_USE_PARTICLES
+
666  // Update tracer particles on level 0
+
667  if (lev == 0 && use_tracer_particles) {
+
668  MultiFab* Umac = &vars_new[lev][Vars::xvel];
+
669  tracer_particles->AdvectWithUmac(Umac, lev, dt_lev, *vec_z_phys_nd[0]);
+
670  }
+
671 #endif
+
672 
+
673 
+
674  //We are not storing computed W aka Omega
+
675  // MultiFab::Copy(W_new,mf_w,0,0,W_new.nComp(),IntVect(AMREX_D_DECL(NGROW-1,NGROW-1,0)));
+
676  // W_new.FillBoundary();
+
677  // MultiFab::Copy(mf_W,S_old,Omega_comp,0,mf_W.nComp(),mf_w.nGrowVect());
+
678 
+
679 // set_drag(lev);
+
680 
+
681 }
@@ -1483,6 +1486,7 @@

amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_t3
Definition: ROMSX.H:309
void coriolis(const amrex::Box &bx, const amrex::Box &gbx, amrex::Array4< amrex::Real > uold, amrex::Array4< amrex::Real > vold, amrex::Array4< amrex::Real > ru, amrex::Array4< amrex::Real > rv, amrex::Array4< amrex::Real > Hz, amrex::Array4< amrex::Real > fomn, int nrhs, int nr)
Definition: ROMSX_coriolis.cpp:10
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_svstr
Definition: ROMSX.H:279
+
void set_vmix(int lev)
Definition: ROMSX.cpp:634
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rvfrc
Definition: ROMSX.H:248
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bvstr
Definition: ROMSX.H:285
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bustr
Definition: ROMSX.H:283
@@ -6058,7 +6062,6 @@

623 }
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_x_r
Definition: ROMSX.H:263
void set_weights(int lev)
Definition: ROMSX_set_weights.cpp:10
-
void set_vmix(int lev)
Definition: ROMSX.cpp:634
AMREX_FORCE_INLINE int ComputeGhostCells(const int &spatial_order)
Definition: ROMSX.H:1009
void set_hmixcoef(int lev)
Definition: ROMSX.cpp:642
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_m
Definition: ROMSX.H:855