コード例 #1
0
        os.calcVerticalMixingRichardson(sp)
        os.calcHorizontalDiffusivitySmagorinsky(sp)
        if sp.modeSplittingOn:
            os.calcHorizontalDiffusivitySmagorinsky2D(sp)

    # Set boundary values:
    setBounds(scenario, fullDims, fullDepth, pos, splits, slice, t, os, sp)

    # Set freshwater:
    if sp.freshwaterOn:
        freshwater.addFreshwater(scenario, fullDims, pos, splits, slice, t, os,
                                 sp)

    # Set atmo values:
    if sp.atmoOn:
        atmo.setAtmo(scenario, fullDims, pos, splits, slice, t, os)

    # Calculate T and S for next time step:
    advection.advectTempSalt(os, sp)

    # Advect passive tracer:
    if sp.passiveTracer:
        advection.advectPassiveTracer(os, sp)
        os.X[1:-1, 1:-1, :] = os.X_next[1:-1, 1:-1, :]

########################## Saving initial values ###################################
    if sample == 0:
        if Path(inputFileName).exists():
            netcdfStorage.saveInputFile(inputFileName, iStart, iEnd, jStart,
                                        jEnd, kmax_input, os, 0, sp.tEnd)
        else:
コード例 #2
0
        os.calcHorizontalDiffusivitySmagorinsky(sp)
        if sp.modeSplittingOn:
            os.calcHorizontalDiffusivitySmagorinsky2D(sp)

    # Set boundary values:
    setBounds(scenario, fullDims, fullDepth, pos, splits, slice, t, os, sp)

    # Set freshwater:
    if sp.freshwaterOn:
        freshwater.addFreshwater(scenario, fullDims, pos, splits, slice, t, os,
                                 sp)

    # Set atmo values:
    if sp.atmoOn:
        #atmo.setAtmo(scenario, fullDims, slice, t, os)
        atmo.setAtmo(scenario, comm, fullDims, doMpi, rank, pos, splits, slice,
                     t, os)

    #import sys
    #sys.exit()

    # Calculate T and S for next time step:
    advection.advectTempSalt(os, sp)

    # Advect passive tracer:
    if sp.passiveTracer:
        advection.advectPassiveTracer(os, sp)
        os.X[1:-1, 1:-1, :] = os.X_next[1:-1, 1:-1, :]

    # Calculate U, V and E for next time step. Calculation method depends on simulation settings:
    if sp.modeSplittingOn:
        # Mode splitting means a split barotropic-baroclinic integration scheme that is more efficient: