562 class(Mesh2dModelType), intent(inout) :: this
563
564
565 call nf_verify(nf90_def_var(this%ncid, this%mesh_name, nf90_int, &
566 this%var_ids%mesh), this%nc_fname)
567
568
569 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, 'cf_role', &
570 'mesh_topology'), this%nc_fname)
571 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, 'long_name', &
572 '2D mesh topology'), this%nc_fname)
573 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, &
574 'topology_dimension', 2), this%nc_fname)
575 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, 'face_dimension', &
576 'nmesh_face'), this%nc_fname)
577 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, &
578 'node_coordinates', 'mesh_node_x mesh_node_y'), &
579 this%nc_fname)
580 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, &
581 'face_coordinates', 'mesh_face_x mesh_face_y'), &
582 this%nc_fname)
583 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh, &
584 'face_node_connectivity', 'mesh_face_nodes'), &
585 this%nc_fname)
586
587
588 call nf_verify(nf90_def_var(this%ncid, 'mesh_node_x', nf90_double, &
589 (/this%dim_ids%nmesh_node/), &
590 this%var_ids%mesh_node_x), this%nc_fname)
591
592
593 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, &
594 'units', this%lenunits), this%nc_fname)
595 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, &
596 'standard_name', 'projection_x_coordinate'), &
597 this%nc_fname)
598 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, &
599 'long_name', 'Easting'), this%nc_fname)
600
601 if (this%gridmap_name /= '') then
602
603 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_x, &
604 'grid_mapping', this%gridmap_name), &
605 this%nc_fname)
606 end if
607
608
609 call nf_verify(nf90_def_var(this%ncid, 'mesh_node_y', nf90_double, &
610 (/this%dim_ids%nmesh_node/), &
611 this%var_ids%mesh_node_y), this%nc_fname)
612
613
614 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, &
615 'units', this%lenunits), this%nc_fname)
616 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, &
617 'standard_name', 'projection_y_coordinate'), &
618 this%nc_fname)
619 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, &
620 'long_name', 'Northing'), this%nc_fname)
621
622 if (this%gridmap_name /= '') then
623
624 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_node_y, &
625 'grid_mapping', this%gridmap_name), &
626 this%nc_fname)
627 end if
628
629
630 call nf_verify(nf90_def_var(this%ncid, 'mesh_face_x', nf90_double, &
631 (/this%dim_ids%nmesh_face/), &
632 this%var_ids%mesh_face_x), this%nc_fname)
633
634
635 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, &
636 'units', this%lenunits), this%nc_fname)
637 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, &
638 'standard_name', 'projection_x_coordinate'), &
639 this%nc_fname)
640 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, &
641 'long_name', 'Easting'), this%nc_fname)
642 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, 'bounds', &
643 'mesh_face_xbnds'), this%nc_fname)
644 if (this%gridmap_name /= '') then
645
646 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_x, &
647 'grid_mapping', this%gridmap_name), &
648 this%nc_fname)
649 end if
650
651
652 call nf_verify(nf90_def_var(this%ncid, 'mesh_face_xbnds', nf90_double, &
653 (/this%dim_ids%max_nmesh_face_nodes, &
654 this%dim_ids%nmesh_face/), &
655 this%var_ids%mesh_face_xbnds), &
656 this%nc_fname)
657
658
659 call nf_verify(nf90_def_var(this%ncid, 'mesh_face_y', nf90_double, &
660 (/this%dim_ids%nmesh_face/), &
661 this%var_ids%mesh_face_y), this%nc_fname)
662
663
664 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, &
665 'units', this%lenunits), this%nc_fname)
666 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, &
667 'standard_name', 'projection_y_coordinate'), &
668 this%nc_fname)
669 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, &
670 'long_name', 'Northing'), this%nc_fname)
671 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, 'bounds', &
672 'mesh_face_ybnds'), this%nc_fname)
673
674 if (this%gridmap_name /= '') then
675
676 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_y, &
677 'grid_mapping', this%gridmap_name), &
678 this%nc_fname)
679 end if
680
681
682 call nf_verify(nf90_def_var(this%ncid, 'mesh_face_ybnds', nf90_double, &
683 (/this%dim_ids%max_nmesh_face_nodes, &
684 this%dim_ids%nmesh_face/), &
685 this%var_ids%mesh_face_ybnds), &
686 this%nc_fname)
687
688
689 call nf_verify(nf90_def_var(this%ncid, 'mesh_face_nodes', nf90_int, &
690 (/this%dim_ids%max_nmesh_face_nodes, &
691 this%dim_ids%nmesh_face/), &
692 this%var_ids%mesh_face_nodes), &
693 this%nc_fname)
694
695
696 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, &
697 'cf_role', 'face_node_connectivity'), &
698 this%nc_fname)
699 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, &
700 'long_name', &
701 'Vertices bounding cell (counterclockwise)'), &
702 this%nc_fname)
703 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, &
704 '_FillValue', (/nf90_fill_int/)), &
705 this%nc_fname)
706 call nf_verify(nf90_put_att(this%ncid, this%var_ids%mesh_face_nodes, &
707 'start_index', 1), this%nc_fname)