Opened 9 months ago

Last modified 7 months ago

#642 assigned defect

snowdz with zero values at the end of explicitsnow_main

Reported by: ajornet Owned by: cottle
Priority: major Milestone: ORCHIDEE 3.0
Component: Biogeochemical processes Version: trunc
Keywords: ch4_soil snowdz Cc:

Description

After the inclusion of the discretized carbon forcesoil file, the following issue raised up:

[irene1014:97517:0] Caught signal 8 (Floating point exception)
==== backtrace ====
 2 0x000000000006ba2c mxm_handle_error()  /var/tmp/OFED_topdir/BUILD/mxm-3.7.3111/src/mxm/util/debug/debug.c:641
 3 0x000000000006bf7c mxm_error_signal_handler()  /var/tmp/OFED_topdir/BUILD/mxm-3.7.3111/src/mxm/util/debug/debug.c:616
 4 0x000000000000f5d0 _L_unlock_13()  funlockfile.c:0
 5 0x0000000000fefe86 stomate_soil_carbon_discretization_mp_soil_gasdiff_coeff_()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/stomate/stomate_soil_carbon_discretization.f90:1652
 6 0x0000000000fd971d stomate_soil_carbon_discretization_mp_soil_gasdiff_main_()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/stomate/stomate_soil_carbon_discretization.f90:1447
 7 0x0000000000fbdc9c stomate_soil_carbon_discretization_mp_stomate_soil_carbon_discretization_deep_somcycle_()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/stomate/stomate_soil_carbon_discretization.f90:1001
 8 0x0000000000b12740 stomate_mp_stomate_main_()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/stomate/stomate.f90:1472
 9 0x00000000009d7847 slowproc_mp_slowproc_main_()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/sechiba/slowproc.f90:734
10 0x000000000091f425 sechiba_mp_sechiba_main_()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/sechiba/sechiba.f90:839
11 0x00000000005a91a9 intersurf_mp_intersurf_main_2d_()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/sechiba/intersurf.f90:579
12 0x000000000050bc1b MAIN__()  /ccc/work/cont003/dsmipsl/p529jorn/modipsl_trunk/modeles/ORCHIDEE_trunk_cforcing_ch4soil/build/ppsrc/orchidee_ol/dim2_driver.f90:1285
13 0x000000000044695e main()  ??:0
14 0x0000000000022495 __libc_start_main()  ??:0
15 0x0000000000446869 _start()  ??:0

By taking a look were the floating pointing exception takes place:

    DO il = 1,nsnow-1
       !
       WHERE ( snow_height_mask_2d(:,:) .AND. veget_mask_2d(:,:) )
          !
          xcO2_snow(:,il,:) = ( zf_snow(:,il,:) - zf_snow(:,il-1,:) ) * &
               totporO2_snow(:,il,:) / time_step
          xcCH4_snow(:,il,:) = ( zf_snow(:,il,:) - zf_snow(:,il-1,:) ) * &
               totporCH4_snow(:,il,:) / time_step
          !
          xdO2_snow(:,il,:) = diffO2_snow(:,il,:) /  &
               (zi_snow(:,il+1,:)-zi_snow(:,il,:)) <<-------------HERE, division by 0
          xdCH4_snow(:,il,:) = diffCH4_snow(:,il,:) /  &
               (zi_snow(:,il+1,:)-zi_snow(:,il,:))
          !
       ENDWHERE
    END DO

zi_snow is variable calculated by using snowdz. For that reason, snowdz is deeply checked throughout the code by tracing its changed values:

 explicitsnow_main:: begin, snowdz=  9.971282281093744E-004 0.000000000000000E+000  0.000000000000000E+000
 explicitsnow_fall:: snowdz=  9.971282281093744E-004  0.000000000000000E+000  0.000000000000000E+000
 explicitsnow_levels:: snowdz=  3.323760760364581E-004  3.323760760364582E-004   3.323760760364581E-004
 explicitsnow_main:: after levels, snowdz=  3.323760760364581E-004  3.323760760364582E-004  3.323760760364581E-004
 explicitsnow_transf:: snowdz=  3.323760760364581E-004  3.323760760364581E-004   3.323760760364581E-004
 explicitsnow_compactn:: snowdz=  3.307082347811091E-004  3.307071684104765E-004   3.307061020467210E-004
 explicitsnow_main:: after compactn, snowdz=  3.307082347811091E-004   3.307071684104765E-004  3.307061020467210E-004
 explicitsnow_main:: after profile, snowdz=  3.307082347811091E-004   3.307071684104765E-004  3.307061020467210E-004
 explicitsnow_main:: after gone, snowdz=  0.000000000000000E+000 0.000000000000000E+000  0.000000000000000E+000    <----- Snow removed !
 explicitsnow_melt_refrz:: snowdz=  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000
 explicitsnow_main:: after metl_refrz, snowdz=  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000
 explicitsnow_main:: 1st snowmelt_from_maxmass, subsnowveg=  -5.589300636728523E-002
 explicitsnow_main:: 1st snowmelt_from_maxmass, snowrho=   55.5706140888494
 explicitsnow_main:: 1st snowmelt_from_maxmass, ZSNOWEVAPS=  -1.005801488497506E-003
 explicitsnow_main:: 1st snowmelt_from_maxmass, ZSNOWDZ=  1.005801488497506E-003
 explicitsnow_main:: 1st snowmelt_from_maxmass, snowdz=  1.005801488497506E-003
 explicitsnow_main:: before snowmelt_from_maxmass, snowdz=   1.005801488497506E-003  0.000000000000000E+000  0.000000000000000E+000  <---- Snow introduced in the 1st layer
 explicitsnow_main:: before snowgrain, snowdz=  1.005801488497506E-003   0.000000000000000E+000  0.000000000000000E+000
 explicitsnow_main:: after snowgrain, snowdz=  1.005801488497506E-003  0.000000000000000E+000  0.000000000000000E+000
 explicitsnow_main:: end, snowdz=  1.005801488497506E-003 0.000000000000000E+000  0.000000000000000E+000
 snowlevels:: snowdz=  1.005801488497506E-003  0.000000000000000E+000   0.000000000000000E+000

After the call "before snowmelt_from_maxmass", a minimum amount of snow is introduced in the first layer. But it is never scattered across the different layers before leaving explicitsnow_main.

Change History (7)

comment:1 Changed 9 months ago by ajornet

Potential fix:

[p529jorn@irene171 ORCHIDEE_trunk_cforcing]$ svn diffIndex: src_sechiba/explicitsnow.f90===================================================================
--- src_sechiba/explicitsnow.f90	(revision 6373)
+++ src_sechiba/explicitsnow.f90	(working copy)
@@ -555,6 +555,9 @@
        END IF
     END DO
 
+    snow_depth_tmp(:) = SUM(snowdz(:,:),2)
+    CALL explicitsnow_levels(kjpindex,snow_depth_tmp, snowdz)
+
     CALL xios_orchidee_send_field("snowliq",snowliq_diag)
     CALL xios_orchidee_send_field("snowliqtot", snowliqtot_diag)
     CALL xios_orchidee_send_field("snowrho",snowrho_diag)

Recalculate the snowdz layers at the end of explicitsnow_main. After applying the patch, this simulation succesfully finishes.

comment:2 Changed 9 months ago by jgipsl

As decided during the ORCHIDEE meeting today, this has now been done in the trunk revision [6402]

comment:3 Changed 9 months ago by maignan

Albert has discussed this problem with FM and CO who both agreed with the proposed solution.
The snow scheme needs to have either no snow or snow in the three levels.
When there is a snowfall on a soil with no former snow, it is first attributed to the first level and then split between the three levels.
In the case identified by Albert, snow was condensed on the first layer but no repartition was further made. A call to explicitsnow_levels has thus been added.

comment:4 Changed 9 months ago by maignan

  • Resolution set to fixed
  • Status changed from new to closed

comment:5 Changed 7 months ago by dzhu

I have a question: the proposed modification re-splits the total snow depth among the three layers at the end of explicitsnow_main, but has not modified snow density of each layer afterwards. Will it cause a non-conservation in total snow mass, when snow depth and density are passed to the next time loop?

comment:6 Changed 7 months ago by maignan

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:7 Changed 7 months ago by jgipsl

  • Owner changed from somebody to cottle
  • Status changed from reopened to assigned

Said today during ORCH meeting: Catherine will add an answer of the question and close the ticket.

Note: See TracTickets for help on using tickets.