示例#1
0
inputFileName = filePath + "init_" + str(np.char.zfill(strrank, 3)) + ".nc"
#####################################################################

if coldStart:
    scenario.initialize(sp)  # Set up scenario
    os = scenario.getOs()  # Get OceanState object from the scenario
    utils.adaptDepthField(
        os
    )  # Make some adjustments to ensure the depth field works well with bounds
    if sp.passiveTracer:
        scenario.initPassiveTracer()

else:
    # Load saved model state:
    scenario.initialize(sp)  # Set up scenario
    os = netcdfStorage.loadState(sp, 'f:/work/pyMiniOcean/fjord1.nc',
                                 40)  # Load OceanState from file
    utils.adaptDepthField(
        os
    )  # Make some adjustments to ensure the depth field works well with bounds
    scenario.os = os  # Set the scenario's OceanState object
    #os.U = 0*os.U
    #os.V = 0*os.V

# If we are using mode splitting, after initialization we need to calculate the initial
# values of the depth integrated speeds and deviations:
if sp.modeSplittingOn:
    os.calc2D3D()

    #plt.figure()
    #plt.pcolor(np.transpose(os.UB[:,:,0])), plt.colorbar()
    #plt.show()
示例#2
0
else:
    print("One process only, disabling MPI communication.")

if coldStart:
    scenario.initialize(sp)  # Set up scenario
    os = scenario.getOs()  # Get OceanState object from the scenario
    utils.adaptDepthField(
        os
    )  # Make some adjustments to ensure the depth field works well with bounds
    if sp.passiveTracer:
        scenario.initPassiveTracer()

else:
    # Load saved model state:
    scenario.initialize(sp)  # Set up scenario
    os = netcdfStorage.loadState(sp, sp.config['initFile'],
                                 -1)  # Load OceanState from file
    utils.adaptDepthField(
        os
    )  # Make some adjustments to ensure the depth field works well with bounds
    scenario.os = os  # Set the scenario's OceanState object
    #os.U = 0*os.U
    #os.V = 0*os.V

# If we are using mode splitting, after initialization we need to calculate the initial
# values of the depth integrated speeds and deviations:
if sp.modeSplittingOn:
    os.calc2D3D()

    #plt.figure()
    #plt.pcolor(np.transpose(os.UB[:,:,0])), plt.colorbar()
    #plt.show()